MCPcopy Create free account
hub / github.com/Botloader/botloader / NativeReaderWriter

Class NativeReaderWriter

components/runtime/src/ts/unstable/streams.ts:17–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 * @internal
16 */
17export class NativeReaderWriter implements AsyncReader, AsyncWriter, AsyncReadCloser {
18 rid: number;
19
20 constructor(rid: number) {
21 this.rid = rid
22 }
23
24 read(buf: Uint8Array): Promise<number> {
25 return Deno.core.read(this.rid, buf);
26 }
27
28 write(data: Uint8Array): Promise<number> {
29 return Deno.core.write(this.rid, data)
30 }
31
32 close(): void {
33 Deno.core.close(this.rid);
34 }
35}
36
37/**
38 * @internal

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected