I want to send a buffered image across the network as part of my custom class.
I currently just writeObject and readObject to get my class.
To send the image im currently doing:
((DataBufferByte) i.getData().getDataBuffer()).getData();
How do i convert that back in to a BufferedImage?
Is there a better way to be doing this?
The class i send looks like:
public class imagePack{
public byte[] imageBytes;
public String clientName;
public imagePack(String name, BufferedImage i){
imageBytes = ((DataBufferByte) i.getData().getDataBuffer()).getData();
clientName = name;
}
public BufferedImage getImage(){
//Do something to return it}
}
Thanks again