I solve this problem by making the BufferedImage transient.
2013/5/27 Jonas
> Well, you can't serialize the BufferedImage, but maybe you can serialize
> whatever data you've used to render BufferedImage's contents,
> i.e. instead of saving the image, save whatever is necessary to recreate
> th
Well, you can't serialize the BufferedImage, but maybe you can serialize
whatever data you've used to render BufferedImage's contents,
i.e. instead of saving the image, save whatever is necessary to recreate
the image?
Or, you could store the BufferedImage's content to an actual image file
(using I
Thanks.
But in my example , I cannot modify BufferedImage (to add a no-arg
constructor)
What should I do if I want to output a BufferedImage (and make back button
work) ?
2013/5/14 Jonas
> This could only work if BufferedImage itself had a no-arg constructor.
> It is it the first non-serializa
This could only work if BufferedImage itself had a no-arg constructor.
It is it the first non-serializable class in the hierarchy that needs to
have it,
not the first serializable one, like in your example.
Besides, you would still lose all data stored in the BufferedImage's fields
(i.e.
the image
Today I encountered one famous deserialization problem :
InvalidClassException : no valid constructor
I googled and found some solution , but all are in-vain.
The solution says the first non-serializable super class should define a
no-arg constructor.
But I try to define a no-arg constructor to E