| 15 | * @internal |
| 16 | */ |
| 17 | export 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 |
nothing calls this directly
no outgoing calls
no test coverage detected