Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.8.0
-
None
Description
The documentation for org.apache.commons.io.input.ReaderInputStream says:
Given the fact that the Reader class doesn't provide any way to predict whether the next read operation will block or not, it is not possible to provide a meaningful implementation of the InputStream.available() method. A call to this method will always return 0.
However, Reader does actually provide such functionality: Reader.ready().
But properly implementing available() might be tricky, see related Guava pull request.
Therefore it might be easiest to change the documentation, stating that available() always returns 0 without providing a reason for it.
Or available() could at least return a result based on encoderOut.