libp2p
    Preparing search index...

    Interface ByteStream<S>

    interface ByteStream<S extends MessageStream> {
        read(options: ReadBytesOptions): Promise<Uint8ArrayList>;
        read(options?: AbortOptions): Promise<null | Uint8ArrayList>;
        unwrap(): S;
        write(
            data: Uint8Array<ArrayBufferLike> | Uint8ArrayList,
            options?: AbortOptions,
        ): Promise<void>;
    }

    Type Parameters

    Index

    Methods

    Methods

    • After calling this method the stream can no longer be used. Any unread data will be emitted as a message event during the microtask queue of the current event loop tick.

      Returns S