-
Type:
Bug
-
Status: Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.1
-
Fix Version/s: 1.2
-
Component/s: Compressors
-
Labels:None
BZip2CompressorInputStream,init() will throw an IOException, if the passed stream returns 0 for available():
BZip2CompressorInputStream.java
private void init() throws IOException { ... if (in.available() == 0) { throw new IOException("Empty InputStream"); } ... }
I think this is not correct, because the underlying stream may indeed be able to only return 0 bytes without blocking but may be able to block a little and then return some more bytes.
Note also the change in the API documentation from: "Returns the number of bytes that can be read " (1.4.2) to "Returns an estimate of the number of bytes that can be read".