This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

readObject() method  RSS feed

 
raddikrishna kittur
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HI friends ,
can anybody tell me the return value when Object readObject() reaches the endof a stream .My need is i have written stauts of 5 objects into a file I want to read back them .
Thanks in advance
 
Matt Senecal
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what the value is, but it shouldn't be too hard to test. All you need to do is make a loop that keeps doing a readObject() on a stream. Give it a file to read and print the results of each readObject() to the screen. When the stream runs out you'll see exactly what the value is. My hunch is that it throws an EOFException.
Originally posted by raddikrishna kittur:

HI friends ,
can anybody tell me the return value when Object readObject() reaches the endof a stream .My need is i have written stauts of 5 objects into a file I want to read back them .
Thanks in advance

 
Ryan Langley
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
It will return null.
------------------
Cheers,
RL
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!