Java sockets - how to determine data type on the server side?

Posted by markovuksanovic on Stack Overflow See other posts from Stack Overflow or by markovuksanovic
Published on 2010-05-07T18:37:10Z Indexed on 2010/05/07 18:48 UTC
Read the original article Hit count: 161

Filed under:
|
|

I'm using Java sockets for client - server application. I have a situation when sometimes client needs to send a byte array (using byteArrayOutputStream) and sometimes it should send a custom java object. How can I read the information from the input stream on the server side and determine what is in the stream so that I can properly process that?

© Stack Overflow or respective owner

Related posts about java

Related posts about sockets