This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Appeding to a File  RSS feed

 
Venki Ramanathan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on Object Serialization. Using FileOutputSteam i am writing the object to a file ( "obj.txt" ). I want to use the same file (Obj.txt) next time and start appending some more objects into that same file. Is that possible. Please help me
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried the constructor FileOutputStream(String name, boolean append)? It will create a new file if one doen't exist but, if one does it opens it and positions to the end of the file so all write operations append to the end of the file.
Hope this helps

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