ByteLengthQueuingStrategy: size()-Methode
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die size()
-Methode der ByteLengthQueuingStrategy
-Schnittstelle gibt die byteLength
-Eigenschaft des gegebenen Datenchunks zurück.
Syntax
js
size(chunk)
Parameter
chunk
-
Ein Datenchunk, der durch den Stream übergeben wird.
Rückgabewert
Ein ganzzahliger Wert, der die Bytegröße des gegebenen Chunks darstellt.
Beispiele
js
const queuingStrategy = new ByteLengthQueuingStrategy({ highWaterMark: 1 });
const readableStream = new ReadableStream(
{
start(controller) {
// …
},
pull(controller) {
// …
},
cancel(err) {
console.log("stream error:", err);
},
},
queuingStrategy,
);
const size = queueingStrategy.size(chunk);
Spezifikationen
Specification |
---|
Streams # blqs-size |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
size |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.
Siehe auch
ByteLengthQueuingStrategy()
-Konstruktor