BinaryEncoder writes directly to ArrayBuffer, improves memory consumption

This commit is contained in:
Kevin Jahns
2018-05-23 16:06:38 +02:00
parent 4ef36ab81c
commit c122bdc750
3 changed files with 73 additions and 19 deletions

View File

@@ -9,7 +9,7 @@ function testEncoding (t, write, read, val) {
write(encoder, val)
let reader = new BinaryDecoder(encoder.createBuffer())
let result = read(reader)
t.log(`string encode: ${JSON.stringify(val).length} bytes / binary encode: ${encoder.data.length} bytes`)
t.log(`string encode: ${JSON.stringify(val).length} bytes / binary encode: ${encoder.length} bytes`)
t.compare(val, result, 'Compare results')
}