Results 1 to 3 of 3
  1. #1
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

    Default [SOLVED] Save the current buffer to file

    Hi, im new here and new to java

    i was wondering if someone could help me out with some code on how to save the current buffer to a file.


    Thanks heaps

    regard

  2. #2
    DonCash's Avatar
    DonCash is offline Moderator
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    240
    Rep Power
    9

    Default

    Java Code:
    Writer output = null;
    output = new BufferedWriter(new FileWriter("myfile.txt"));
    String newline = System.getProperty("line.separator");
    
    output.write("whatever you want");
    output.write(newline);
    
    output.close();
    Did this post help you? Please me! :cool:

  3. #3
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

Similar Threads

  1. [SOLVED] Delete Current line from file
    By Azndaddy in forum New To Java
    Replies: 2
    Last Post: 04-06-2012, 08:00 AM
  2. How to Save/Load Vector to/from file
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 08:37 PM
  3. How to get Current Directory through File
    By Java Tip in forum java.io
    Replies: 0
    Last Post: 04-05-2008, 10:14 AM
  4. save file to database
    By katerinaaa in forum New To Java
    Replies: 0
    Last Post: 08-14-2007, 12:15 PM
  5. Replies: 1
    Last Post: 08-07-2007, 05:09 AM

Posting Permissions

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