Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
7 results across 6 corpora for ArrayBuffer.
Encyclopedia 1
WebSocket
to WebSocket using the DEFLATE algorithm on a per-message basis. // Connect to server const ws = new WebSocket("wss://game.example.com/scoreboard"); // Receive ArrayBuffer instead of Blob ws.binaryType = "arraybuffer"; // Set event listeners ws.onopen = () => { console.log("Connection opened"); ws.send("Hi server, please send me the score of yesterday's game"); }; ws.onmessage = (event: MessageEvent) => { console.log
Developer library 6
Audio for Web games
use it, so let's create an `async` function to allow us to do this: ```js async function getFile(filepath) { const response = await fetch(filepath); const arrayBuffer = await response.arrayBuffer(); const audioBuffer = await audioCtx.decodeAudioData(arrayBuffer); return audioBuffer; } ``` We can then use the `await` operator when calling this function, which ensures that we can run subsequent code when it h
JavaScript instance accessor property page template
ayed at the top of the page. Format as `Constructor.prototype.nameOfTheProperty`. For example, the [`byteLength`](/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength) property of the [`ArrayBuffer`](/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) class has a _title_ of `ArrayBuffer.prototype.byteLength`. > > It's almost always the case that accessor properties are installed on `Constru
WebAssembly
Reference/JavaScript_interface/Memory) - : An object whose [`buffer`](/docs/WebAssembly/Reference/JavaScript_interface/Memory/buffer) property is a resizable ArrayBuffer that holds the raw bytes of memory accessed by a WebAssembly `Instance`. - [`WebAssembly.Module`](/docs/WebAssembly/Reference/JavaScript_interface/Module) - : Contains stateless WebAssembly code that has already been compiled by the browser and c
WebAssembly.Memory
The **`WebAssembly.Memory`** object is a resizable ArrayBuffer or SharedArrayBuffer that holds raw bytes of memory accessed by a [`WebAssembly.Instance`](/docs/WebAssembly/Reference/JavaScript_interface/Instance). Both WebAssembly and JavaScript can create `Memory` objects. If you want to access the memory created in JS from WebAssembly, or vice versa, you can export the memory from the module to JavaScript or impor
WebAssembly.Memory() constructor
.Memory()`** constructor creates a new `Memory` object whose [`buffer`](/docs/WebAssembly/Reference/JavaScript_interface/Memory/buffer) property is a resizable ArrayBuffer or SharedArrayBuffer that holds the raw bytes of memory accessed by a [`WebAssembly.Instance`](/docs/WebAssembly/Reference/JavaScript_interface/Instance). A memory object created by JavaScript or in WebAssembly code will be accessible and mutable
WebAssembly.Memory.prototype.grow()
n)); // 1n ``` ### Detachment upon growing Every call to `grow` will detach any references to the old `buffer`, even for `grow(0)`! Detachment means that the ArrayBuffer's `byteLength` becomes zero, and it no longer has bytes accessible to JavaScript. Accessing the `buffer` property after calling `grow`, will yield an `ArrayBuffer` with the correct length. ```js example-bad const memory = new WebAssembly.Memory({