S
Spendius
Hi,
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
I have a file containing integers:
2375 2485 6323
2485 2375 6323
2376 2377 3659
2318 4436 0
2377 2376 3659
2377 2399 3755
2399 2377 3755
....
thru which I loop using
File f = new File("./values.txt");
BufferedReader in = new BufferedReader(new FileReader(f));
then
while ((line = in.readLine()) != null)
{ ...
I've noticed I get out of the loop (and thus from the sequential
reading of my file) when I encounter a line ending with '0' (ZERO
value). I've tried different ways of instantiating my InputStream
but to no avail... The break out of the loop really happens when
I stumble against this 0, I've checked it by moving my 4rd line
above to other positions in the file and every time I loop as
many times as I read non-ending-with-0 lines...
How can you explain that ? How could I deal with this funny
behaviour ? Isn't it a bug or something ?
Thanks !
Regards,
Spendius
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
I have a file containing integers:
2375 2485 6323
2485 2375 6323
2376 2377 3659
2318 4436 0
2377 2376 3659
2377 2399 3755
2399 2377 3755
....
thru which I loop using
File f = new File("./values.txt");
BufferedReader in = new BufferedReader(new FileReader(f));
then
while ((line = in.readLine()) != null)
{ ...
I've noticed I get out of the loop (and thus from the sequential
reading of my file) when I encounter a line ending with '0' (ZERO
value). I've tried different ways of instantiating my InputStream
but to no avail... The break out of the loop really happens when
I stumble against this 0, I've checked it by moving my 4rd line
above to other positions in the file and every time I loop as
many times as I read non-ending-with-0 lines...
How can you explain that ? How could I deal with this funny
behaviour ? Isn't it a bug or something ?
Thanks !
Regards,
Spendius