MCPcopy Create free account
hub / github.com/denoland/std / read

Function read

io/reader_from_stream_reader.ts:31–42  ·  view source on GitHub ↗
(p: Uint8Array)

Source from the content-addressed store, hash-verified

29
30 return {
31 async read(p: Uint8Array): Promise<number | null> {
32 if (buffer.empty()) {
33 const res = await streamReader.read();
34 if (res.done) {
35 return null; // EOF
36 }
37
38 await writeAll(buffer, res.value);
39 }
40
41 return buffer.read(p);
42 },
43 };
44}

Callers

nothing calls this directly

Calls 3

writeAllFunction · 0.90
readMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected