この記事は編集レビューを必要としています。ぜひご協力ください。
この翻訳は不完全です。英語から この記事を翻訳 してください。
概要
ArrayBufferの開始位置からの(バイト単位の)長さを表します。
構文
dataview.byteLength
説明
byteLengthプロパティはsetアクセス関数がundefinedであるアクセスプロパティです。これは、このプロパティが読み取り専用であることを意味します。その値は、DataViewが構築されるときに設定され、変更されません。DataViewがoffset、もしくは、byteLength、byteLengthを指定していない場合、参照されているArrayBufferが返されます。
例
byteLengthプロパティを使う
var buffer = new ArrayBuffer(8); var dataview = new DataView(buffer); dataview.byteLength; // 8 (matches the byteLength of the buffer) var dataview2 = new DataView(buffer, 1, 5); dataview2.byteLength; // 5 (as specified when constructing the DataView) var dataview3 = new DataView(buffer, 2); dataview3.byteLength; // 6 (due to the offset of the constructed DataView)
仕様
| 仕様 | ステータス | コメント |
|---|---|---|
| ECMAScript 6 (ECMA-262) The definition of 'DataView.prototype.byteLength' in that specification. |
勧告候補 | 初期定義。 |
ブラウザ実装状況
| 機能 | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| 基本サポート | 9.0 | 15.0 (15.0) | 10 | 12.1 | 5.1 |
| 機能 | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| 基本サポート | 4.0 | (有) | 15.0 (15) | ? | 12.0 | 4.2 |