Java - Sending an object that points to a BufferedImage through a Socket

后端 未结 3 401
别那么骄傲
别那么骄傲 2020-12-22 10:17

Me and a group of friends are working on a project in Java, and we need some help regarding sending objects through sockets.

So far, we have achieved to send simple

3条回答
  •  甜味超标
    2020-12-22 11:10

    If you want to use Objects Streams, you can wrap buffered image inside a class that implements Serializable and has a attribute that is a array of bytes (image data as byte array). You'll have to modify your code, changing BufferedImage references to SerializableImage(class name example)..

    If you do that, your class will be serialized and transferred..

提交回复
热议问题