Commit Graph

9 Commits

Author SHA1 Message Date
Andy Balholm 2848168f55 Reader.Reset: recover from errors.
When a Reader encounters an error, its internal state may be corrupted.
So Reset needs to be extra thorough, to avoid cascading errors.

Based on PR 37 by Sovianum.
2022-09-23 19:39:05 -07:00
Andy Balholm 786ec621f6 Reuse ringbuffer in Reader.
Fixes #33
2022-05-18 12:06:45 -07:00
Andy Balholm 177b8acd6c Add test for issue 22. 2021-07-15 12:01:31 -07:00
Andy Balholm 8f8b18645c Read multiple bytes in findMatchLengthWithLimit
Use 64- or 32-bit loads instead of reading a byte at a time. The
original C source did something like this, in a very C-ish way. It
needed to be simplified to translate it to Go. The exact way this works
was suggested by the assembly code in github.com/golang/snappy.
2020-05-15 10:43:19 -07:00
Andy Balholm 511ca97d30 Benchmark all compression levels. 2020-05-06 16:08:01 -07:00
Andy Balholm cb9be97eb7 Reuse more memory when a Writer is Reset. 2020-05-05 17:18:33 -07:00
Andy Balholm ed0fd64940 Fix int overflow in test on 32-bit.
On 32-bit systems, the random array indexes were sometimes negative as a
result of converting an int64 to int.

Fixes #7.
2019-07-25 08:52:43 -07:00
Andy Balholm f00818cf36 Fix tests broken by API change. 2019-04-25 09:03:32 -07:00
Andy Balholm 0da14edee1 Make BrotliDecoderState into a Reader. 2019-03-06 17:08:24 -08:00