libp2p
    Preparing search index...

    Interface ByteStream<S>

    interface ByteStream<S extends MessageStream> {
        read(
            options: ReadBytesOptions,
        ): Promise<Uint8ArrayList<ArrayBufferLike>>;
        read(
            options?: AbortOptions,
        ): Promise<Uint8ArrayList<ArrayBufferLike> | null>;
        unwrap(): S;
        write(
            data: Uint8Array<ArrayBufferLike> | Uint8ArrayList<ArrayBufferLike>,
            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