Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/encoding/binary.ts>getNBytes

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function getNBytes
import { getNBytes } from "https://deno.land/std@0.38.0/encoding/binary.ts";

Reads n bytes from r.

Returns it in a Uint8Array, or throws Deno.errors.UnexpectedEof if n bytes cannot be read.

Parameters

r: Deno.Reader
n: number

Returns

Promise<Uint8Array>