Details
-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b93
-
Verified
Description
This bug is created to track inconsistencies in java.io.FileInputStream.
The available() method returns a negative value when the file position is beyond the current file size. This is unspecified behavior that has the potential to break applications that expect available to return a value of 0 or greater. This appears to be long standing behavior. Note that Files.newInputStream returns an InputStream that returns 0 for the same case.
The skip(long) method allows a negative value to be provided. This conflicts with both the InputStream and FIleInputStream specification. Again, this seems to be long standing behavior and may require changes to the specification of both classes.
Attachments
Issue Links
- duplicates
-
JDK-8048174 BufferedInputStream.available always return Integer.MAX_VALUE
- Resolved
- relates to
-
JDK-6294974 FileInputStream.skip(long) does not stop at EOF
- Resolved
-
JDK-8010837 FileInputStream.available() Throw IOException When Encountering Negative Available Values
- Closed