|
Writing to DAT or TXT file
//------------------------------------------------------------------
...
String Username = "hunterbdb";
byte[] bite2 = new byte[100];
bite2 = username.getBytes();
FileOutputStream fos = new FileOutputStream
("C:\\Documents andSettings\\Administrator\\Desktop\\java projects\\notepads\\messenger_users.text", true);
fos.write(bite2,0,bite2.length);
...
//------------------------------------------------------------------
Hi, this is the code I'm using to write to a .txt file.
username is the String that I converted to bytes so that I can send through the FileoutputStream.
what i'm trying to do is append//add to the notepad file's text, however it is not working. Nothing is written to the file.
Am I doing something wrong?
Golden Brownies to the genius that helps me!
Last edited by hunterbdb : 10-11-2008 at 10:38 AM.
|