Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/willow_utils/mod.ts>GrowingBytes

TypeScript typings and utilities for the Willow protocol.
Go to Latest
class GrowingBytes
Re-export
import { GrowingBytes } from "https://deno.land/x/willow_utils@0.8.0/mod.ts";

An array of growing bytes which can be awaited upon and pruned.

Constructors

new
GrowingBytes(incoming: AsyncIterable<Uint8Array>)

Properties

private
deferredUntilLength: [number, Deferred<Uint8Array>] | null
array: Uint8Array

Methods

private
next(ofLength: number, relative: boolean): Promise<Uint8Array>
nextAbsolute(length: number): Promise<Uint8Array>

Wait for the underyling Uint8Array to grow to at least the absolute given length.

nextRelative(length: number): Promise<Uint8Array>

Wait for the underyling Uint8Array to grow relative to the given length, regardless of the current length.

prune(length: number)

Prunes the array by the given bytelength.