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

Saving contents of Stack using Object Serialization  RSS feed

 
Bob Lomax
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose I have a Stack class which acts as a runtime stack which I use to store stuff, how do i write all the contents of the stack to file using obj serialization? do i invoke writeObject() and just pass a Stack object in? or is there a catch to this?
i tried this and even when i pop more stuff onto the stack, the output file remains the same size and the binary characters are only less than half a line long and doesnt seem right. whats wrong?
also, for a stack that constantly receives data, how do u modify the exception bit so that if the stack overflows, the current data in the stack is saved to file via obj serialization?
thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!