Reads up to
p.byteLength bytes into
p. It resolves to the number
of bytes read (
p.byteLength) and rejects if any error
encountered. Even if
p.byteLength, it may use
p as scratch space during the call. If some data is available
readSync() conventionally returns what is
available instead of waiting for more.
readSync() encounters end-of-file condition, it returns EOF
readSync() encounters an error, it throws with an error.
Callers should always process the
0 bytes returned before
considering the EOF (
null). Doing so correctly handles I/O errors that happen
after reading some bytes and also both of the allowed EOF behaviors.
Implementations should not retain a reference to
Use iterSync() from https://deno.land/std/io/util.ts to turn a ReaderSync into an Iterator.