[OpenJDK 2D-Dev] Why are java images type not serializable ?

Jean-François Savard j-f.savard at hotmail.com
Tue Mar 10 17:20:17 UTC 2015


Hi,

I've realized java.awt.image.BufferedImage is not serializable.
After a couple of research, I've realized that each java image types (correct me if I'm wrong) are not serializable at all.
I've then decided to do research without specifying java as language and realized serialization of image is not present in most of the languages. I've come to the conclusion that is simply because serializing an image is illogical. When you load an image, it is because you already have the resource stored somewhere (file or in-memory), so there is no point in serializing it as the main utility of serialization is to store data independent of the JVM, which is already the case for an image file. For the case where the image is in-memory, it mean you already loaded the ressource and have the byte array so it is better to simply serialize that byte array.
Would you please confirm that my understanding is correct ? 

Best regards. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20150310/e2171568/attachment.html>


More information about the 2d-dev mailing list