nateperson
March 3rd, 2009, 05:01 PM
I'm a fairly new Java programmer, so bare with me a bit. I was using PrintWriter to print my output to a txt file, until I realized that it wasn't always printing out everything, seeming to stop after some limit has been reached, usually between 900 and 1500 lines of text. I rewrote my code to use FileOutputStream and PrintStream.
I was using PrintWriter by:
PrintWriter outputFile = new PrintWriter("SomeOutput.txt");
outputFile.prinln("Hello World");
Now I'm printing out by:
FileOutputStream outputFile = new FileOutputStream("ADiffrentOutput.txt");
PrintStream printOutput = new PrintStream(outputFile);
printOutput.println("Hello World");
SO, my question is, what was I doing wrong, and am I doing stuff correctly now? You see, I now have to go back and reprint out my results for the past few weeks/months(hope not) and reanalyze them, and I really don't want to have to do it a 3rd time.
Thanks
Nate
I was using PrintWriter by:
PrintWriter outputFile = new PrintWriter("SomeOutput.txt");
outputFile.prinln("Hello World");
Now I'm printing out by:
FileOutputStream outputFile = new FileOutputStream("ADiffrentOutput.txt");
PrintStream printOutput = new PrintStream(outputFile);
printOutput.println("Hello World");
SO, my question is, what was I doing wrong, and am I doing stuff correctly now? You see, I now have to go back and reprint out my results for the past few weeks/months(hope not) and reanalyze them, and I really don't want to have to do it a 3rd time.
Thanks
Nate