From 0c6ac37ec570f3c3f488e888fcd939414f6b287e Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 21 May 2024 14:08:38 +1000 Subject: [PATCH] Add bytes() method for reading bytes into a Uint8Array --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.html b/index.html index 8b6511e..e3316ac 100644 --- a/index.html +++ b/index.html @@ -976,6 +976,7 @@

interface PushMessageData { ArrayBuffer arrayBuffer(); Blob blob(); + Uint8Array bytes(); any json(); USVString text(); }; @@ -993,6 +994,11 @@

The blob() method, when invoked, MUST return a {{Blob}} whose contents are |bytes| and |type| is not provided.

+

+ The bytes() method, when invoked, MUST return a {{Uint8Array}} backed by a + {{ArrayBuffer}} whose contents are |bytes|. Exceptions thrown during the creation of the + {{ArrayBuffer}} object are re-thrown. +

The json() method, when invoked, MUST return the result of invoking the initial value of `JSON`.{{JSON/parse()}} with the result of running utf-8 decode on |bytes|