Skip to main content
Module

std/encoding/binary.ts>getNBytes

Deno standard library
Go to Latest
function getNBytes
Deprecated
Deprecated

(will be removed after 0.205.0) Use ReadableStreamBYOBReader to read exact number of bytes.

Reads exactly n bytes from r.

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

import { getNBytes } from "https://deno.land/std@0.202.0/encoding/binary.ts";

Parameters

n: number

Returns

Promise<Uint8Array>