feat(serialize, parse): Number, String, Array, ConstString, ConstArray
This commit is contained in:
15
test/index.js
Normal file
15
test/index.js
Normal file
@ -0,0 +1,15 @@
|
||||
export function filledDataView(bytes) {
|
||||
const ab = new ArrayBuffer(bytes.length)
|
||||
const dv = new DataView(ab)
|
||||
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
dv.setInt8(i, bytes[i])
|
||||
}
|
||||
|
||||
return dv
|
||||
}
|
||||
|
||||
export function sizedDataView(length) {
|
||||
const ab = new ArrayBuffer(length)
|
||||
return new DataView(ab)
|
||||
}
|
||||
Reference in New Issue
Block a user