I recently use ObjectOutputStream to write objects in TCP/IP socket programming.
If I want to write a large size of List<Object>/ArrayList<Object> through the socket
(e.g. list.size: 100, the total bytes may larger than the payload size),
should I just call writeObject(List<Object>/ArrayList<Object>)?
Is that OK, or any Exception occurs?
Does ObjectOutputStream automatically split the list to a few segments before sending the packets? Or it doesn't support?
Is there another way to send a large size of an object?
As for ObjectInputStream, can I just call readObject() to receive the large size of List<Object>/ArrayList<Object>?
Thanks in advance.
->
Another questions: Does ObjectInputStream receive anything when the list is not fully sent from the sender? I want to close the socket but the ObjectOutputStream is still sending the list. Does it shutdown immediately when I close socket, and the list segments are destroyed?