Is it possible to create a serialized BufferedImage? If so, how?
The application for this is to store an image using ObjectOutputStream.
:o :o :o
Is it possible to create a serialized BufferedImage? If so, how?
The application for this is to store an image using ObjectOutputStream.
:o :o :o
the ImageIO class reads and writes images. Use that instead!
Ye, just write the image data as png (because it’s lossless).
ImageIO.write(image, “png”, new File(“out.png”));
You can also just write to a stream.
Well, the reason I wanted it serialized was to avoid having to use imageio everytime I load stuff. eg. for tiles I want to store the image in the tile object along with all it’s properties…