I have an object that allows me to store a BufferedImage in my object file. In the same object, I have a BufferedImage variable that I use to cache the image after loading it for the first time from an array of raw data. Everything works fine when I create an object and save it to a file since BufferedImage is null. The problem occurs when I update the loaded object, and the variable is initialized, and I want to save the object after updating it.
Is it possible to save the serializable object to a file, excluding some variables? Or maybe I can reset somehow change the BufferedImage variable while saving the file?
Thanks in advance, Serhiy.
java serialization file-io bufferedimage
Serhiy
source share