I am simply trying to send a bufferedimage object from one computer to another using Netty.
I am really having a tough time with the decoder/encoder. Mainly getting the bytes from the bufferedimage, but I have a feeling that this may not be the right way to go about it. I was looking at ChannelBufferInput/OutputStreams.
BufferedImage is not Serializable, so you'd have to roll the code by hand. The easiest approach might be to use the javax.imageio.ImageIO class to write the image in a lossless format -like PNG- to an OutputStream (which, I assume, the I/O layer can handle).
Joined: Jan 14, 2012
Thank you for the quick response!
write the image in a lossless format -like PNG-
Does this mean writing it to disk?
I've been poking around I found ObjectEncoder and ObjectDecoder, but I am starting to get very confused after looking at the different encoder/decoders.
I'm not sure how to implement this. I wish there was more example code