mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 17:49:16 +02:00
Add some tests for BitStreams
This commit is contained in:
parent
e7ef46fb78
commit
981ac156ac
2 changed files with 82 additions and 23 deletions
|
@ -53,7 +53,7 @@ bitjs.io.ByteBuffer = class {
|
|||
* @param {number} numBytes The number of bytes to write the number into.
|
||||
*/
|
||||
writeNumber(num, numBytes) {
|
||||
if (numBytes < 1) {
|
||||
if (numBytes < 1 || !numBytes) {
|
||||
throw 'Trying to write into too few bytes: ' + numBytes;
|
||||
}
|
||||
if (num < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue