I have an object which allows me to store BufferedImage into my object file. In the same object I have BufferedImage variable which I use to cache the image after it's loaded first time from raw data array. Everything works fine when I'm creating object and storing it to file, since BufferedImage is null. The problem comes when I'm updating loaded object and the variable is being initialized and I want to save the object after it's updated.
Is there any possibility to store the serializable object to file, excluding some of the variables? Or maybe I can reset somehow my BufferedImage variable when storing to file?
Thanks in advance, Serhiy.
you should mark the attribute you don't want to serialize as transient :
private transient BufferedImage image;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With