1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

docs(arrayBuffer): edit arrayBuffer

This commit is contained in:
ruanyf 2017-10-27 13:35:10 +08:00
parent 55a79524a6
commit 22b0f1d472

View File

@ -62,7 +62,7 @@ const dataView = new DataView(buf);
dataView.getUint8(0) // 0
```
上面代码对一段32字节的内存建立`DataView`视图然后以不带符号的8位整数格式偏移0开始读取8bit数据结果得到0因为原始内存的`ArrayBuffer`对象默认所有位都是0。
上面代码对一段32字节的内存建立`DataView`视图然后以不带符号的8位整数格式头读取8位二进制数据结果得到0因为原始内存的`ArrayBuffer`对象默认所有位都是0。
另一种 TypedArray 视图,与`DataView`视图的一个区别是,它不是一个构造函数,而是一组构造函数,代表不同的数据格式。