Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InputStreamByteChunkProvider#isAvailable #850

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vorobii-vitalii
Copy link

@vorobii-vitalii vorobii-vitalii commented Dec 11, 2024

Hello!

There is issue in this function -

return super.isAvailable() || (is != null && is.available() > 0);
.
According to docs - https://docs.oracle.com/javase/8/docs/api/java/io/BufferedInputStream.html. BufferedInputStream#available returns only estimate of the number of bytes that can be read.
And one of implementations of InputStream we rely on actually always returns zero before reading.
Please review my approach. I've tested it and it works as expected

@vorobii-vitalii
Copy link
Author

@hierynomus Any news??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant