|
Here's some generic code to write to a text file,
maybe it will help. If not, you can read up on the OutputStream
classes I'm using and probably find out how to do what you
want.
OutputStream rawFile = null; OutputStream bufferedFile = null; PrintStream theFile = null; String data = "Whatever you
want;
// write it out to the logfile in buffered fashion. // average data size is 3K, so a 4K buffer ought to do // for ensuring only a single disk write try { rawFile = new FileOutputStream("C:\whatever.txt", true); bufferedFile = new BufferedOutputStream(rawFile, 4096); theFile = new PrintStream(bufferedFile, true); theFile.println(data); } finally { if(theFile != null) theFile.close(); if(bufferedFile != null) bufferedFile.close(); if(rawFile != null) rawFile.close(); } Jeff
|