mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 17:49:16 +02:00
Add a BitBuffer to the io package and a few tests
This commit is contained in:
parent
596a859bdc
commit
24b1603968
12 changed files with 747 additions and 25 deletions
|
@ -25,11 +25,13 @@ bitjs.io.ByteBuffer =
|
|||
if (typeof numBytes != typeof 1 || numBytes <= 0) {
|
||||
throw "Error! ByteBuffer initialized with '" + numBytes + "'";
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {Uint8Array}
|
||||
* @public
|
||||
*/
|
||||
this.data = new Uint8Array(numBytes);
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @public
|
||||
|
@ -122,7 +124,7 @@ bitjs.io.ByteBuffer =
|
|||
}
|
||||
this.insertByte(curByte);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return ByteBuffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue