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
  • Loading branch information
plafer committed Jun 28, 2015
1 parent b436e59 commit 911adf2
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 911adf2

Please sign in to comment.