Date: Thu, 24 Jul 1997 16:11:42 +0200
From: ###@###.### (Friedhelm Kunkel)
To: ###@###.###
Subject: read with RandomAccessFile delivers 0 instead of -1 at EOF
When I open a file with the FileInputStream, the "read" gives me a "-1"
if reach EOF.
When I open a file with RandomAccessFile and "r" (maybe also "rw") , the
"data_read = fis.read(data, 0, TRY_COUNT) gives me a "0" if I reach
EOF and not
"-1", I would expect. This could lead to endless loops in file handling.
Maybe
this is an error of the jdk1.1.1, I use. This behaviour is independent of
Solaris or NT.
From: ###@###.### (Friedhelm Kunkel)
To: ###@###.###
Subject: read with RandomAccessFile delivers 0 instead of -1 at EOF
When I open a file with the FileInputStream, the "read" gives me a "-1"
if reach EOF.
When I open a file with RandomAccessFile and "r" (maybe also "rw") , the
"data_read = fis.read(data, 0, TRY_COUNT) gives me a "0" if I reach
EOF and not
"-1", I would expect. This could lead to endless loops in file handling.
Maybe
this is an error of the jdk1.1.1, I use. This behaviour is independent of
Solaris or NT.
- duplicates
-
JDK-4017497 java.io.RandomAccessFile.readFully() hangs on EOF
-
- Closed
-