Skip to content

SPR-17492: FastByteArrayOutputStream.read byte-to-int conversion #2016

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

Merged
merged 1 commit into from
Nov 20, 2018

Conversation

janotav
Copy link

@janotav janotav commented Nov 13, 2018

While evaluating FastByteArrayOutputStream I have noticed that it doesn't behave correctly when negative bytes are encountered in the read() method.

Quoting from InputStream javadoc:

The value byte is returned as an int in the range 0 to 255

To make the situation more obvious in the test I have deliberately used another InputStream implementation to make the situation clear and avoided using constant that could be confusing.

@pivotal-issuemaster
Copy link

@janotav Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@janotav Thank you for signing the Contributor License Agreement!

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.

3 participants