1
0
Fork 0
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:
Jeff Schiller 2021-12-20 20:35:59 -08:00
parent 596a859bdc
commit 24b1603968
12 changed files with 747 additions and 25 deletions

View file

@ -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;