getBigInt64()
方法从 DataView
开始获取一个指定偏移量的有符号64位整数 (long long) 。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
语法
dataview.getBigInt64(byteOffset [, littleEndian])
参数
- byteOffset
- 偏移量,以字节为单位。指明视图开始读取数据的偏移量。
- littleEndian
-
可选 指明该64位整型数值的存储方式(
大小端模式) 。 如果为
false
或undefined
, 则按大端方式读取数据。
返回值
一个 BigInt
.
异常抛出
-
RangeError
-
如果
byteOffset
设置的偏移量超出了视图的范围,则抛出该异常。
简介
- 没有对齐约束;
- 可以从任何偏移量获取多字节值。
例子
使用 getBigInt64
方法
var buffer = new ArrayBuffer(8); var dataview = new DataView(buffer); dataview.getBigInt64(0); // 0n
规范
规范版本 | 规范状态 | 注解 |
---|---|---|
DataView.prototype.getBigInt64 proposal |
浏览器兼容性
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.
Update compatibility data on GitHub
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getBigInt64 |
Chrome Full support 67 | Edge No support No | Firefox Full support 68 | IE No support No | Opera Full support 54 | Safari No support No | WebView Android Full support 67 | Chrome Android Full support 67 | Firefox Android Full support 68 | Opera Android Full support 48 | Safari iOS No support No | Samsung Internet Android Full support 9.0 | nodejs Full support 10.4.0 |
Legend
- Full support
- Full support
- No support
- No support