DataView.prototype.getInt16()
DataView 实例的 getInt16() 方法从该 DataView 的指定字节偏移量开始读取 2 个字节,并将它们解释为 16 位有符号整数。没有对齐约束;多字节值可以从边界内的任何偏移量获取。
¥The getInt16() method of DataView instances reads 2 bytes starting at the specified byte offset of this DataView and interprets them as a 16-bit signed integer. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.
Try it
语法
参数
¥Parameters
byteOffset-
从读取数据的视图开始的偏移量(以字节为单位)。
littleEndianOptional-
表示数据是否以 小端或大端 格式存储。如果是
false或undefined,则读取大端值。
返回值
例外情况
示例
使用 getInt16()
规范
| Specification |
|---|
| ECMAScript Language Specification # sec-dataview.prototype.getint16 |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also