Blob: stream() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
メモ: この機能はウェブワーカー内で利用可能です。
stream()
は Blob
インターフェイスのメソッドで、ReadableStream
を返します。これは、読み取り時に、Blob
に含まれるデータを返します。
構文
js
stream()
引数
なし。
返値
読み取り時に、Blob
の内容を ReadableStream
で返します。
使用上のメモ
stream()
と返された ReadableStream
を使用すると、いくつかの興味深い機能を得ることができます。
- 返されたストリーム上で
getReader()
を呼び出すと、ReadableStreamDefaultReader
インターフェイスのread()
メソッドのようなメソッドを使用して、Blob からデータを読み取るために使用するオブジェクトを取得できます。 - 返されたストリームの
pipeTo()
メソッドを呼び出すと、Blob のデータを書き込み可能なストリームにパイプ接続します。 - 返されたストリームの
tee()
メソッドを呼び出すと、読み取り可能なストリームを分岐します。これは、2 つの新しいReadableStream
オブジェクトを含む配列を返し、それぞれがBlob
の内容を返します。 - 返されたストリームの
pipeThrough()
メソッドを呼び出すと、ストリームをTransformStream
またはその他の読み取り可能なもの、および書き込み可能ものの組にパイプ接続します。
仕様書
Specification |
---|
File API # dom-blob-stream |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stream() |
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.