Skip to content

Commit 6b6bd21

Browse files
plaferjasnell
authored andcommitted
doc: Clarified read method with specified size argument.
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 <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
1 parent cb660ab commit 6b6bd21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/stream.markdown

+3-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ returns it. If there is no data available, then it will return
227227
`null`.
228228

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

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

0 commit comments

Comments
 (0)