Skip to content

Return valid length from RandomShortReadInputStream.read#1060

Merged
ArneBab merged 1 commit into
hyphanet:nextfrom
bertm:random-valid-length
Jun 22, 2025
Merged

Return valid length from RandomShortReadInputStream.read#1060
ArneBab merged 1 commit into
hyphanet:nextfrom
bertm:random-valid-length

Conversation

@bertm

@bertm bertm commented May 11, 2025

Copy link
Copy Markdown
Contributor

Returning 0 bytes in InputStream is only allowed when 0 bytes are requested (by setting the length parameter to 0). Otherwise, an InputStream is expected to block until at least one byte is available (yielding that byte) or until the end of the stream is reached (returning -1 as the return value).

This class is only used for testing, but still nice to have it conformant.

Returning 0 bytes in InputStream is only allowed when 0 bytes are
requested (by setting the length parameter to 0). Otherwise, an
InputStream is expected to block until at least one byte is available
(yielding that byte) or until the end of the stream is reached
(returning -1 as the return value).
@ArneBab ArneBab merged commit 073d1ba into hyphanet:next Jun 22, 2025
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