Streams API の ByteLengthQueuingStrategy
インターフェイスは、ストリームを構築するときに使用できる組み込みのバイト長キューイング戦略を提供します。
コンストラクター
ByteLengthQueuingStrategy()
- 新しい
ByteLengthQueuingStrategy
オブジェクトのインスタンスを作成します。
プロパティ
なし。
メソッド
ByteLengthQueuingStrategy.size()
- 所与のチャンクの
byteLength
プロパティを返します。
例
const queueingStrategy = new ByteLengthQueuingStrategy({ highWaterMark: 1 });
const readableStream = new ReadableStream({
start(controller) {
...
},
pull(controller) {
...
},
cancel(err) {
console.log("stream error:", err);
}
}, queueingStrategy);
var size = queueingStrategy.size(chunk);
仕様
仕様 | 状態 | コメント |
---|---|---|
Streams ByteLengthQueuingStrategy の定義 |
現行の標準 | 初期定義 |
ブラウザーの互換性
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.