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.

DataView 인스턴스의 getBigUint64() 메서드는 이 DataView의 지정된 바이트 오프셋에서 8바이트를 읽고 이를 부호없는 64비트 정수로 해석합니다. 정렬 제약 조건은 없으며, 범위 내의 모든 오프셋에서 멀티바이트 값을 가져올 수 있습니다.

시도해보기

// 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 Optional

리틀 엔디언 혹은 빅 엔디언 형식으로 저장할지 여부를 나타냅니다. false 혹은 undefined이라면 빅 엔디안 값을 읽습니다.

반환 값

0 이상 264-1 이하의 BigInt

예외

RangeError

뷰의 끝을 넘어 읽는 수도 있는 byteOffset이 설정된 경우 발생합니다.

예제

getBigUint64() 사용하기

js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getBigUint64(1)); // 72623859790382856n

명세서

Specification
ECMAScript® 2025 Language Specification
# sec-dataview.prototype.getbiguint64

브라우저 호환성

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
Node.js
getBigUint64

Legend

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

Full support
Full support

같이 보기