Re: Deserialization InvalidClassException : no valid constructor

2013-05-27 Thread 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 the image? Or, you could store the BufferedImage's content to an actual image file (using

Re: Deserialization InvalidClassException : no valid constructor

2013-05-27 Thread smallufo
I solve this problem by making the BufferedImage transient. 2013/5/27 Jonas barney...@gmail.com 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

Re: Deserialization InvalidClassException : no valid constructor

2013-05-21 Thread smallufo
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 barney...@gmail.com This could only work if BufferedImage itself had a no-arg constructor. It is it the

Re: Deserialization InvalidClassException : no valid constructor

2013-05-14 Thread Jonas
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