Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
doc: Clarified read method with specified size argument.
Browse files Browse the repository at this point in the history
Made explicitely clear that when size bytes are not available, it will
return null, unless we've ended, in which case the data remaining in the
buffer will be returned.

Fixes #7273

Reviewed-By: James M Snell <[email protected]>
PR-URL: #25591
  • Loading branch information
plafer authored and jasnell committed Aug 4, 2015
1 parent cb660ab commit 6b6bd21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/api/stream.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ returns it. If there is no data available, then it will return
`null`.

If you pass in a `size` argument, then it will return that many
bytes. If `size` bytes are not available, then it will return `null`.
bytes. If `size` bytes are not available, then it will return `null`,
unless we've ended, in which case it will return the data remaining
in the buffer.

If you do not specify a `size` argument, then it will return all the
data in the internal buffer.
Expand Down

0 comments on commit 6b6bd21

Please sign in to comment.