MCPcopy Create free account
hub / github.com/awayjs/core / setArrayBuffer

Method setArrayBuffer

lib/utils/ByteArray.ts:20–31  ·  view source on GitHub ↗
(aBuffer: ArrayBuffer)

Source from the content-addressed store, hash-verified

18 }
19
20 public setArrayBuffer(aBuffer: ArrayBuffer): void {
21 this.ensureSpace(aBuffer.byteLength);
22
23 this.length = aBuffer.byteLength;
24
25 const inInt8AView: Int8Array = new Int8Array(aBuffer);
26 const localInt8View: Int8Array = new Int8Array(this.arraybytes, 0, this.length);
27
28 localInt8View.set(inInt8AView);
29
30 this.position = 0;
31 }
32
33 public writeArrayBuffer(aBuffer: ArrayBuffer): void {
34 this.ensureWriteableSpace(aBuffer.byteLength);

Callers 1

toByteArrayMethod · 0.95

Calls 2

ensureSpaceMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected