• Post Reply Bookmark Topic Watch Topic
  • New Topic

File append

 
sangeetha balasubramaniam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to append the content of the file.

Right now I am reading the already existing content, then making the necessary append to the content. Finally writing the whole content to file.

I am using BufferedReader for reading and OutputStream for writing.
 
Henry Wong
author
Sheriff
Posts: 22539
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sangeetha balasubramaniam:

I am using BufferedReader for reading and OutputStream for writing.


When you say "OutputStream for writing", I am assuming you are using the FileOutputStream class... Take a look at the constructors for the FileOutputStream class. You'll notice that one of the contructors take a boolean flag to append to the end of the file.

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