- From: Takeshi Yoshino <notifications@github.com>
- Date: Sun, 15 Mar 2015 23:56:11 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Message-ID: <whatwg/streams/pull/279/c81457193@github.com>
`readableAmount getter` was proposed for users of hypothetical underlying sources which can tell how many bytes can be read synchronously to pass a single contiguous buffer of sufficient enough size to `readInto()` call while keeping it able to consume only part of the synchronously readable data not to replenish back pressure too much. But when I revisited the issue, I think that it doesn't make much sense. - If the total size to read into a single contiguous buffer is known, they can just allocate a buffer of the size and repeat invoking `readInto()` until it's filled. - If the total size is unknown, we may still need to repeat `readInto()` calls if parts of data arrive little by little. If reading into a single contiguous buffer doesn't really matter, we can just read into some small buffer and process bytes in it repeatedly. It just works. `readableAmount getter` just reduces the number of `readInto()` call. That's not big benefit. Closing for now. Can be opened if necessary. --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/pull/279#issuecomment-81457193
Received on Monday, 16 March 2015 06:58:23 UTC