FileReader.readAsArrayBuffer()

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.

FileReader インターフェイスの readAsArrayBuffer() メソッドは、指定された Blob ないし File オブジェクトの内容を読み込むために使用します。読み込み処理が終了すると readyStateDONE に変わり、 loadend イベントが発行されます。それと同時に、 result プロパティにはファイルのデータを表す ArrayBuffer が格納されます。

メモ: Blob.arrayBuffer() メソッドは、ファイルを ArrayBuffer として読み取るためのプロミスベースのより新しい API です。

構文

js
readAsArrayBuffer(blob)

引数

blob

メソッドで読み込む Blob または File オブジェクトです。

返値

なし (undefined)。

仕様書

Specification
File API
# readAsArrayBuffer

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
readAsArrayBuffer

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報