Web APIs

ByteLengthQueuingStrategy()

Try the free JavaScript compiler

Use chunk byteLength to estimate queue size for streams with byte-sized chunks. The high-water mark guides backpressure rather than enforcing an allocation limit. Example console output: 16 5.

Formal Syntax & Structure

javascript syntaxjavascript
new ByteLengthQueuingStrategy({highWaterMark})

Parameters & Attributes

NameTypeDescription
optionsobjectRequired highWaterMark number.

Return Value

ByteLengthQueuingStrategy

Byte-length strategy.

Working Example

Example Snippetjavascript
const strategy=new ByteLengthQueuingStrategy({highWaterMark:16}); console.log(strategy.highWaterMark,strategy.size(new Uint8Array(5)));
JavaScript Reference