MCPcopy Index your code
hub / github.com/awayjs/core / writeByte

Method writeByte

lib/utils/ByteArray.ts:80–88  ·  view source on GitHub ↗
(b: number)

Source from the content-addressed store, hash-verified

78 }
79
80 public writeByte(b: number): void {
81 this.ensureWriteableSpace(1);
82
83 const view = new Int8Array(this.arraybytes);
84 view[ this.position++ ] = (~~b); // ~~ is cast to int in js...
85 if (this.position > this.length) {
86 this.length = this.position;
87 }
88 }
89
90 public readByte(): number {
91 if (this.position >= this.length)

Callers 2

constructorMethod · 0.95
ByteArrayTestFunction · 0.45

Calls 1

ensureWriteableSpaceMethod · 0.95

Tested by

no test coverage detected