Formatter format method output limit?
I'm on Windows 7 and my Formatter object only wants to write out about 2500 values to file. After that the file is abruptly cut off in the middle of a number, and is just empty after that. I know the while loop is executing the full 4200 times, and iter.next() is returning correct values for all those iterations because I printed them out as it happened. Nevertheless, the actual writing to file part ends after about the 2500th write-out. Any ideas? Thanks! -Ryan
try{...
output = new Formatter("C:\\users\\ryans\\desktop\\IntelMA.tsv" );
...
}
...
Iterator<Double> iter = MA.getMovingAverage().iterator();
while (iter.hasNext()){
output.format("%f\t", iter.next());
}
Re: Formatter format method output limit?
And I should probably say that MA.getMovingAverage() returns a List<Double>
Re: Formatter format method output limit?
What is the size of the file that is created in bytes?
Re: Formatter format method output limit?
Thanks for responding. It is 24kb.
Re: Formatter format method output limit?
Post your Java version and a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem. You can use Random#nextDouble() to get numbers for formatting so that the program doesn't depend on any other custom class.
db
Re: Formatter format method output limit?
Thanks for helping, everyone. I added an output.close() to the end of the program and now it works. Apparently the Formatter object needed to flush it's buffer.
Re: Formatter format method output limit?
Typical for a sloppy beginner program.