Make UhkBuffer allocate a Buffer.

This commit is contained in:
László Monda
2016-03-25 20:46:33 +01:00
parent 0c7ff11f33
commit b9fe33d5d6
3 changed files with 10 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
class UhkBuffer {
private static eepromSize = 32 * 1024;
private static maxStringByteLength = 0xFFFF;
private static longStringPrefix = 0xFF;
private static stringEncoding = 'utf8';
@@ -7,9 +8,10 @@ class UhkBuffer {
buffer: Buffer;
offset: number;
constructor(buffer: Buffer) {
constructor() {
this.offset = 0;
this.buffer = buffer;
this.buffer = new Buffer(UhkBuffer.eepromSize);
this.buffer.fill(0);
}
readInt8(): number {