• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Saving contents of Stack using Object Serialization

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic