DataView.prototype 表示DataView的原型
DataView.prototype 属性的属性特性: |
|
|---|---|
| writable | false |
| enumerable | false |
| configurable | false |
描述
DataView 的实例从DataView.prototype继承。就像所有的构造器,你可以修改原型来改变生成的DataView实例。
属性
-
DataView.prototype.constructor - 指定用来生成原型的构造函数.初始化值是标准内置DataView构造器.
-
DataView.prototype.buffer只读 -
被视图引入的
ArrayBuffer.创建实例的时候已固化因此是只读的. -
DataView.prototype.byteLength只读 -
从
ArrayBuffer中读取的字节长度. 创建实例的时候已固化因此是只读的. -
DataView.prototype.byteOffset只读 -
从
ArrayBuffer读取时的偏移字节长度. 创建实例的时候已固化因此是只读的.
方法
读
-
DataView.prototype.getInt8() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个8-bit数(一个字节). -
DataView.prototype.getUint8() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个8-bit数(无符号字节). -
DataView.prototype.getInt16() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个16-bit数(短整型). -
DataView.prototype.getUint16() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个16-bit数(无符号短整型). -
DataView.prototype.getInt32() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个32-bit数(长整型). -
DataView.prototype.getUint32() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个32-bit数(无符号长整型). -
DataView.prototype.getFloat32() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个32-bit数(浮点型). -
DataView.prototype.getFloat64() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处获取一个64-bit数(双精度浮点型).
写
-
DataView.prototype.setInt8() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个8-bit数(一个字节). -
DataView.prototype.setUint8() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个8-bit数(无符号字节). -
DataView.prototype.setInt16() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个16-bit数(短整型). -
DataView.prototype.setUint16() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个16-bit数(无符号短整型). -
DataView.prototype.setInt32() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个32-bit数(长整型). -
DataView.prototype.setUint32() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个32-bit数(无符号长整型). -
DataView.prototype.setFloat32() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个32-bit数(浮点型). -
DataView.prototype.setFloat64() -
从DataView起始位置以byte为计数的指定偏移量(byteOffset)处储存一个64-bit数(双精度浮点型).
规范
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) DataView.prototype |
Standard | Initial definition. |
浏览器支持
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 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prototype |
Chrome Full support 9 | Edge Full support 12 | Firefox Full support 15 | IE Full support 10 | Opera Full support 12.1 | Safari Full support 5.1 | WebView Android Full support 4 | Chrome Android Full support 18 | Firefox Android Full support 15 | Opera Android Full support 12.1 | Safari iOS Full support 4.2 | Samsung Internet Android Full support Yes | nodejs Full support Yes |
Legend
- Full support
- Full support