Results 1 to 5 of 5

Thread: File IO [resolved]

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    File IO [resolved]

    Using a BufferedReader and BufferedWriter, is there a way to append to a file rather an overwriting it? Right now I read in the entire file and rewrite it which seems pretty slow.
    Last edited by filburt1; Jan 28th, 2002 at 08:41 PM.

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    public FileOutputStream(String name, boolean apppend) throws FileNotFoundException

    or


    public FileWriter(String name, boolean append) throws IOException

  3. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    What i don't understand is that Java stress writing "pure Java" which means hard coding of files names should not be done. So then why do they add an append parameter to only the constructors that take a hard coded string as an arguement?

  4. #4

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Java is a funky beast.

    Thanks, Dilenger.

  5. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width