MCPcopy Create free account
hub / github.com/WinterTC55/iter-streams / write

Method write

samples/util.ts:102–108  ·  view source on GitHub ↗
(chunk: Uint8Array | string)

Source from the content-addressed store, hash-verified

100 }
101
102 write(chunk: Uint8Array | string): boolean {
103 if (this._closed) throw new Error('Writer is closed');
104 const bytes = typeof chunk === 'string' ? this.enc.encode(chunk) : chunk;
105 this.chunks.push(bytes);
106 this._byteCount += bytes.byteLength;
107 return true;
108 }
109
110 writev(chunks: (Uint8Array | string)[]): boolean {
111 for (const chunk of chunks) {

Callers 1

writevMethod · 0.95

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected