Re: [whatwg/streams] Add ReadableStreamBYOBReader.readFully() (#1145)

@MattiasBuelens commented on this pull request.



> @@ -1382,6 +1392,34 @@ value: newViewOnSameMemory, done: true }</code> for closed streams. If the strea
   <p>If reading a chunk causes the queue to become empty, more data will be pulled from the
   [=underlying source=].
 
+ <dt><code>{ <var ignore>value</var>, <var ignore>done</var> } = await <var ignore>reader</var>.{{ReadableStreamBYOBReader/readFully()|readFully}}(<var ignore>view</var>)</code>
+ <dd>
+  <p>Attempts to read bytes into |view| until it is completely full, and returns a promise resolved
+  with the result:
+
+  <ul>
+   <li>If enough bytes become available to fill |view|, the promise will be fulfilled with an
+   object  of the form <code highlight="js">{ value: theView, done: false }</code>. In this case,
+   |view| will be [=ArrayBuffer/detached=] and no longer usable, but <code>theView</code> will be a

I'm not sure about "theChunk", since in the case of `readFully()` that view may be filled with *multiple* chunks.

I'll replace both "theChunk" and "theView" with "newView" instead, since that also aligns with `respondWithNewView()`. 🙂

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1145#discussion_r692449549

Received on Thursday, 19 August 2021 20:09:44 UTC