Skip to content

ReadableByteStreamController

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2746

The ReadableByteStreamController interface of the Streams API represents a controller for a readable byte stream.

MDN Reference

get byobRequest(): null | ReadableStreamBYOBRequest

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2752

The byobRequest read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.

MDN Reference

null | ReadableStreamBYOBRequest


get desiredSize(): null | number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2758

The desiredSize read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream’s internal queue to its ‘desired size’.

MDN Reference

null | number

close(): void

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2764

The close() method of the ReadableByteStreamController interface closes the associated stream.

MDN Reference

void


enqueue(chunk): void

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2770

The enqueue() method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream’s internal queues).

MDN Reference

ArrayBuffer | ArrayBufferView<ArrayBufferLike>

void


error(reason): void

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2776

The error() method of the ReadableByteStreamController interface causes any future interactions with the associated stream to error with the specified reason.

MDN Reference

any

void