diff --git a/index.bs b/index.bs index c6a0cf7d6..fc4d3cc6a 100644 --- a/index.bs +++ b/index.bs @@ -6365,10 +6365,9 @@ The following algorithms must only be used on {{ReadableStream}} instances initi 1. Let |byobRequest| be ! [$ReadableByteStreamControllerGetBYOBRequest$](|stream|.[=ReadableStream/[[controller]]=]). 1. If |byobRequest| is null, then return null. - 1. Return |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=].\[[ByteLength]]. + 1. Return |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=]'s [=BufferSource/byte length=]. -
To enqueue bytes into a {{ReadableStream}} |stream| given a [=byte sequence=] |bytes|: @@ -6379,17 +6378,16 @@ The following algorithms must only be used on {{ReadableStream}} instances initi 1. Let |byobRequest| be ! [$ReadableByteStreamControllerGetBYOBRequest$](|stream|.[=ReadableStream/[[controller]]=]). 1. If |byobRequest| is null, or |bytes|'s [=byte sequence/length=] > - |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=].\[[ByteLength]], then: - 1. Let |uint8Array| be a new {{Uint8Array}} wrapping an {{ArrayBuffer}} backed by |bytes|. + |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=]'s [=BufferSource/byte length=], then: + 1. Let |uint8Array| be the result of [=ArrayBufferView/creating=] a new {{Uint8Array}} from + |bytes|. 1. Perform ! [$ReadableByteStreamControllerEnqueue$](|stream|.[=ReadableStream/[[controller]]=], |uint8Array|). 1. Otherwise, 1. Assert: |bytes|'s [=byte sequence/length=] ≤ - |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=].\[[ByteLength]]. - 1. Write |bytes| into - |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=].\[[ViewedArrayBuffer]].\[[ArrayBufferData]], - starting at the byte offset given by - |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=].\[[ByteOffset]]. + |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=]'s [=BufferSource/byte length=]. + 1. [=ArrayBufferView/Write=] |bytes| into + |byobRequest|.[=ReadableStreamBYOBRequest/[[view]]=]. Implementations are encouraged to, when possible, do this directly from whatever underlying I/O system is producing |bytes|. In this sense the existence of an intermediate |bytes|