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

Documentation Comment for haxe.io.Output.writeBytes May Be Misleading #6803

Open
ghost opened this issue Jan 3, 2018 · 0 comments
Open

Documentation Comment for haxe.io.Output.writeBytes May Be Misleading #6803

ghost opened this issue Jan 3, 2018 · 0 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jan 3, 2018

The problem is with sentences 2 and 3:

Returns the actual length of written data that can differ from len.
See writeFullBytes that tries to write the exact amount of specified bytes.

One could assume that, if len is greater than the available data to write, only the available data would be written and then that length( less than len ) would be returned.

Sentence 3 can be interpreted as such that, if len is greater than the available data to write and you want the write to fail with an exception, use writeFullBytes instead.

Basically, there is no way the return can be anything but len which is contrary to the documentation.

@Simn Simn added this to the Design milestone Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants