diff options
author | pacien | 2018-11-23 14:16:26 +0100 |
---|---|---|
committer | pacien | 2018-11-23 14:18:37 +0100 |
commit | 0a9579c37894d67d721710a13ecc8250cf702256 (patch) | |
tree | 16cc310161eda8636c876f28ffaef2fa2e9c024c /src | |
parent | 8c40f8aec1ebc7834dcb4a2db4f398fc3c4a2d18 (diff) | |
download | gziplike-0a9579c37894d67d721710a13ecc8250cf702256.tar.gz |
Add streamblock test and fix deserialisation
Diffstat (limited to 'src')
-rw-r--r-- | src/streamblock.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/streamblock.nim b/src/streamblock.nim index 10639ed..49c3dcd 100644 --- a/src/streamblock.nim +++ b/src/streamblock.nim | |||
@@ -38,8 +38,8 @@ proc readSerialised*(bitReader: BitReader): StreamBlock = | |||
38 | result.last = bitReader.readBool() | 38 | result.last = bitReader.readBool() |
39 | result.kind = bitReader.readBits(2, uint8).BlockKind | 39 | result.kind = bitReader.readBits(2, uint8).BlockKind |
40 | case result.kind: | 40 | case result.kind: |
41 | of uncompressed: result.rawBlock = rawblock.readRaw(bitReader) | 41 | of uncompressed: result.rawBlock = rawblock.readSerialised(bitReader) |
42 | of lzss: result.lzssBlock = lzssblock.readRaw(bitReader) | 42 | of lzss: result.lzssBlock = lzssblock.readSerialised(bitReader) |
43 | else: raise newException(ValueError, "unhandled block type") | 43 | else: raise newException(ValueError, "unhandled block type") |
44 | 44 | ||
45 | proc writeSerialisedTo*(streamBlock: StreamBlock, bitWriter: BitWriter) = | 45 | proc writeSerialisedTo*(streamBlock: StreamBlock, bitWriter: BitWriter) = |