HaxeFoundation / HaxeFoundation/haxe

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

Open
#6,803 0 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.