Skip to content

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 nodejs#7273

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#25592
  • Loading branch information
plafer authored and jasnell committed Jul 9, 2015
1 parent 0fc3883 commit 707be4d
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 707be4d

Please sign in to comment.