Thread: Erase with BufferedWriter?

Results 1 to 3 of 3
  1. #1 Erase with BufferedWriter? 
    zipl0ck
    Guest
    This is my writeLog method.

    Code:
    	public void writeLog(String data, String file) {
    		BufferedWriter bw = null;
    
    		try {
    			bw = new BufferedWriter(new FileWriter("../Data/" + file + ".txt", true));
    			bw.write(data);
    			bw.newLine();
    			bw.flush();
    		} catch (IOException ioe) {
    			ioe.printStackTrace();
    		} finally {
    			if (bw != null)
    				try {
    					bw.close();
    				} catch (IOException ioe2) {
    					printOut("Error writing system log.");
    					ioe2.printStackTrace();
    			}
    		}
    	}
    Is there any way to make it erase what I type for data instead of writing it on the file?
    Reply With Quote  
     

  2. #2  
    Member Erase with BufferedWriter? Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    No, a BufferedWriter will write from the beginning of the file to the end.

    Attached imageAttached image
    Reply With Quote  
     

  3. #3  
    zipl0ck
    Guest
    Quote Originally Posted by Luke132 View Post
    No, a BufferedWriter will write from the beginning of the file to the end.
    Is there any way to erase certain words in a text file? Besides doing it manually.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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