Re: [whatwg/encoding] New TextDecoder.decode() API needed for Wasm multithreading (#172)

> .decodeRange(ArrayBuffer|SharedArrayBuffer|TypedArrayView, startIndex, [optional: maxElementsToRead])

Note that this style of (ArrayBuffer, startIndex, length) is exactly a TypedArray, and consensus has been to use Typed Arrays for this API design in the past. See #69 and https://esdiscuss.org/topic/idiomatic-representation-of-buffer-bytesread .

So, that aspect of your before/after code samples would stay the same; you'd still use subarray() with any new APIs we add.

Separately, I don't understand how you find the null byte in your second code example. Are you suggesting decodeRange treat null bytes specially?

-- 
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/encoding/issues/172#issuecomment-461190551

Received on Wednesday, 6 February 2019 21:16:56 UTC