Class LimitedBytesTransformStream
Hierarchy
- TransformStream<Uint8Array, Uint8Array>
- LimitedBytesTransformStream
Index
Constructors
Properties
Constructors
constructor
- new
Limited (size, options?): LimitedBytesTransformStreamBytes Transform Stream Constructs a new instance.
Parameters
- size: number
A size limit in bytes.
- options: LimitedBytesTransformStreamOptions = ...
Options for the stream.
Returns LimitedBytesTransformStream
- size: number
A TransformStream that will only read & enqueue chunks until the total amount of enqueued data exceeds
size. The last chunk that would exceed the limit will NOT be enqueued, in which case a RangeError is thrown whenoptions.erroris set to true, otherwise the stream is just terminated.Example: `size` is equal to the total byte length of the chunks
Example: `size` is less than the total byte length of the chunks, and at the
boundary of the chunks
Example: `size` is less than the total byte length of the chunks, and not at
the boundary of the chunks
Example: Throw error when the total byte length of the chunks exceeds the
specified size
To do so, set
options.errortotrue.