From d3407bc7610e82467236350c2ecac27e3af7e46c Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Sun, 28 Jun 2015 10:08:25 -0400 Subject: [PATCH] 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 PR-URL: https://github.com/joyent/node/pull/25591 --- doc/api/stream.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown index ba4de626cc7573..f0ee5dabd77d15 100644 --- a/doc/api/stream.markdown +++ b/doc/api/stream.markdown @@ -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.