[w3c/FileAPI] Add bytes() method to Blob for reading bytes into a Uint8Array (PR #197)

The Fetch API [is getting](https://github.com/whatwg/fetch/pull/1753) a `Uint8Array`-returning `bytes()` method alongside its existing `arrayBuffer()` method, following [the principle](https://github.com/w3ctag/design-principles/pull/480) that APIs should generally vend byte buffers as `Uint8Array`s.

This PR makes the same change for `Blob`, which has its own distinct `arrayBuffer` method.

I'm assuming this is uncontroversial given the support from the three major implementations for doing this on `Body`, but I can open an issue and solicit explicit support separately if you'd prefer. I'll write tests if I get a signal that this is able to go forward.

 * [ ] Modified Web platform tests (link to pull request)

Implementation commitment:

 * [ ] WebKit (https://bugs.webkit.org/show_bug.cgi?id=)
 * [ ] Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=)
 * [ ] Gecko (https://bugzilla.mozilla.org/show_bug.cgi?id=)


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://pr-preview.s3.amazonaws.com/bakkot/FileAPI/pull/197.html" title="Last updated on May 10, 2024, 4:15 PM UTC (a469c79)">Preview</a> | <a href="https://pr-preview.s3.amazonaws.com/w3c/FileAPI/197/5f1f9f5...bakkot:a469c79.html" title="Last updated on May 10, 2024, 4:15 PM UTC (a469c79)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/FileAPI/pull/197

-- Commit Summary --

  * Add bytes() method to Blob for reading bytes into a Uint8Array

-- File Changes --

    M index.bs (12)

-- Patch Links --

https://github.com/w3c/FileAPI/pull/197.patch
https://github.com/w3c/FileAPI/pull/197.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/pull/197
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/FileAPI/pull/197@github.com>

Received on Friday, 10 May 2024 16:16:18 UTC