概要
ArrayBufferの始まりからのtyped array の(バイト単位の)サイズを表します。
構文
typedarray.byteLength
説明
byteLengthプロパティはsetアクセサがundefinedであるアクセサプロパティです。これは、このプロパティが読み取り専用であることを意味します。その値はTypedArrayの構築時に設定され変更不能です。TypedArrayがbyteOffsetやlengthを指定していないなら、参照されるArrayBufferのlengthが返されます。TypedArrayはTypedArray objectsの一つです。
例
byteLengthプロパティを使う
var buffer = new ArrayBuffer(8); var uint8 = new Uint8Array(buffer); uint8.byteLength; // 8 (matches the byteLength of the buffer) var uint8 = new Uint8Array(buffer, 1, 5); uint8.byteLength; // 5 (as specified when constructing the Uint8Array) var uint8 = new Uint8Array(buffer, 2); uint8.byteLength; // 6 (due to the offset of the constructed Uint8Array)
仕様
| 仕様 | 状況 | コメント |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) TypedArray.prototype.byteLength の定義 |
標準 | Initial definition. |
ブラウザ実装状況
現在、互換性データを可読形式の JSON フォーマットに置き換えているところです。
この互換性一覧は古い形式を使っており、これに含まれるデータの置き換えが済んでいません。
手助けしていただける場合は、こちらから!
| 機能 | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| 基本サポート | 7.0 | 4.0 (2) | 10 | 11.6 | 5.1 |
| 機能 | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| 基本サポート | 4.0 | (有) | 4.0 (2) | 10 | 11.6 | 4.2 |