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 incorrect usage of InputStream.read(byte[]) through code #1458

Closed
lfcnassif opened this issue Dec 21, 2022 · 1 comment
Closed

Fix incorrect usage of InputStream.read(byte[]) through code #1458

lfcnassif opened this issue Dec 21, 2022 · 1 comment
Assignees
Labels

Comments

@lfcnassif
Copy link
Member

Follow up of #1452, we can replace all of them by the safer InputStream.readNBytes() method.

@lfcnassif lfcnassif added the bug label Dec 21, 2022
@lfcnassif lfcnassif self-assigned this Dec 21, 2022
@lfcnassif
Copy link
Member Author

One last curiosity about this: InputStream.read(byte[]) or InputStream.read(byte[], int off, int len) are expected to read at least 1 byte if end of stream is NOT reached (I thought it could return 0 in some situations). InputStream.skip(N) can return 0 even if N > 0 and if end of stream is NOT reached.

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

No branches or pull requests

1 participant