Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help on deserializing bytes from unkown length of stream  RSS feed

 
joseph dela cruz
Ranch Hand
Posts: 38
Chrome Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to clarify if ObjectInputStream results into one receive?

I wrote a program in c# for my school project and when the object is small it serializes and desializes just fine but when the object got big sending its initial size then reading it with readBytes(length);
is not effective anymore it says cannot read beyond the stream and so i searched and then i found that for sending objects to be effective you need message framing since one send does not result to one receive.

now in java i want to know if ObjectInputStream wont result into a multiple receive or if ever please help me correct some of my misconceptions and help me how to do a multiple receive since i have no idea about it. help me out guys

by the way im putting the object through TCP/IP ports and sockets etc.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know C#, so I can't comment on what you said about it. But in Java, you write an object to an ObjectOutputStream using its writeObject() method, and you read an object from an ObjectInputStream using its readObject() method. That's all there is to it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!