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 authored and jasnell committed Jun 29, 2015
1 parent fc18075 commit 69b9c10
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 69b9c10

Please sign in to comment.