You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you read the javadoc for available(), you will see that it is only an estimate of the number of bytes that can be read without blocking. It does not relate to the number of remaining bytes in the stream and available=0 cannot be assumed to mean you have reached the end of the stream.
To Reproduce
I found this by using a SequenceInputStream. It can return 0 when you consume one of the underlying streams but before the SequenceInputStream switches over to the next underlying stream.
Expected behavior
Decoder should read any InputStream to completion.
The text was updated successfully, but these errors were encountered:
Describe the bug
hpack/hpack/src/main/java/com/twitter/hpack/Decoder.java
Line 92 in 713612a
https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html#available--
If you read the javadoc for
available()
, you will see that it is only an estimate of the number of bytes that can be read without blocking. It does not relate to the number of remaining bytes in the stream and available=0 cannot be assumed to mean you have reached the end of the stream.To Reproduce
I found this by using a SequenceInputStream. It can return 0 when you consume one of the underlying streams but before the SequenceInputStream switches over to the next underlying stream.
Expected behavior
Decoder should read any InputStream to completion.
The text was updated successfully, but these errors were encountered: