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

readFully/readAvailable length parameter default value #10

Closed
Xfel opened this issue Sep 22, 2018 · 1 comment
Closed

readFully/readAvailable length parameter default value #10

Xfel opened this issue Sep 22, 2018 · 1 comment

Comments

@Xfel
Copy link

Xfel commented Sep 22, 2018

The array-reading functions readFully and readAvailable are defined with default values for the offset and length parameter.
If you only specify an explicit value for offset, length will default to array.size. If offset is not zero, this leads to an array bounds error, since it tries to write to the range of [offset, offset+length).

A more sensible default might be array.size - offset.

@fzhinkin
Copy link
Collaborator

We're rebooting the kotlinx-io development (see #131), all issues related to the previous versions will be closed. Consider reopening it if the issue remains (or the feature is still missing) in a new version.

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

No branches or pull requests

2 participants