DataView.prototype.getBigUint64()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.
getBigInt64()
メソッドは、符号なし 64 ビット整数 (unsigned long long) を DataView
の先頭からのバイト単位のオフセット位置から取得します。
試してみましょう
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);
// Highest possible BigInt value that fits in an unsigned 64-bit integer
const max = 2n ** 64n - 1n;
const view = new DataView(buffer);
view.setBigUint64(1, max);
console.log(view.getBigUint64(1));
// Expected output: 18446744073709551615n
構文
js
getBigUint64(byteOffset);
getBigUint64(byteOffset, littleEndian);
引数
- byteOffset
-
データを読み取るビューの先頭からのバイト単位のオフセットです。
- littleEndian
-
省略可 64 ビット整数をリトルエンディアンまたはビッグエンディアンのどちらの形式で格納されているかを示します。
false
またはundefined
の場合、ビッグエンディアンの値が読み取られます。
返値
BigInt
です。
発生するエラー
RangeError
-
byteOffset
がビューの末尾を超えて読み取るような値に設定されたときに発生します。
解説
アライメントの制約はありません。複数バイトの値はどのオフセットからでも読み取ることができます。
例
getBigUint64
メソッドの使用
js
var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
dataview.getBigUint64(0); // 0n
仕様書
Specification |
---|
ECMAScript® 2025 Language Specification # sec-dataview.prototype.getbiguint64 |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getBigUint64 |
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.