Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

TypedArray.prototype.byteLength

この記事は編集レビューを必要としています。ぜひご協力ください

この翻訳は不完全です。英語から この記事を翻訳 してください。

概要

ArrayBufferの始まりからのtyped array の(バイト単位の)サイズを表します。

構文

typedarray.byteLength

説明

byteLengthプロパティはsetアクセス関数がundefinedであるアクセスプロパティです。これは、このプロパティを読み込むことのみできることを意味します。その値はTypedArrayが構築されるとき設定され変更されません。TypedArraybyteOffsetlengthを指定していないなら、参照されるArrayBufferlengthが返されます。TypedArrayTypedArray 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)
The definition of 'TypedArray.prototype.byteLength' in that specification.
Standard Initial definition.

ブラウザ実装状況

機能 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

関連情報

ドキュメントのタグと貢献者

 このページの貢献者: shide55
 最終更新者: shide55,