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

Seek to nth object in an ObjectInputStream?  RSS feed

 
Dennis Spathis
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to seek to the nth object
in an ObjectInputStream? I don't want to
have to call readObject() n times to get
the object.
Another question: How can I find out, at
run-time, the number of bytes in an object?
Thanks,
D.
 
Bryan Fagan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dennis:
The ObjectInputStream.GetField inner class provides a way to access objects by name. I don't see a way to access by the nth object.
see the documentation at: http://java.sun.com/j2se/1.3/docs/api/java/io/ObjectInputStream.GetField.html

Originally posted by Dennis Spathis:
Is it possible to seek to the nth object
in an ObjectInputStream? I don't want to
have to call readObject() n times to get
the object.
Another question: How can I find out, at
run-time, the number of bytes in an object?
Thanks,
D.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!