M W

M W

  • NA
  • 3
  • 0

Serialize and send a JPEG image along with a class object

Jun 18 2007 4:03 AM
Hello, I'm working on a program where a user can send a JPEG image to another user, and vice versa. Basically, each instance of the program itself should be a client AND a server i.e. its 'listening' for images sent to it, as well as be able to send images. I'd like to be able to Serialize and send a JPEG image, along with a class object instance that contains some data about the image, such as 'Notes', etc. Basically: [Serializable] class ImageData { String notes; String imageLocation; **ImagePrimitiveType** The Image; //??What is a JPEG type? } As you can see, I'm not sure what the JPEG type would be. I'd like to use binary Serialization as well, unless folks thing XML Serialization would be faster. I was also planning on sending the data using UDP, and am not sure what to do when handling the data stream right after serializing and before deserializing...not so much starting the sockets etc, but handling the byte stream. Any help to point me in the right direction would be great.