1
1
mirror of https://github.com/wader/fq.git synced 2024-12-25 06:12:30 +03:00

Comment on snappy decompression

This commit is contained in:
Xentripetal 2022-02-10 08:55:56 -06:00
parent 21cfc70c38
commit 0909fb6dad

View File

@ -93,6 +93,9 @@ func decodeBlockCodec(d *decode.D, dataSize int64, codec string) *bytes.Buffer {
// Everything but last 4 bytes which are the checksum
n := dataSize - 4
br := d.FieldRawLen("compressed", n*8)
// This could be simplified to be similar to deflate, however snappy's reader only works for streaming frames,
// not block data. See https://github.com/google/snappy/blob/main/framing_format.txt for details.
compressed := make([]byte, n)
if _, err := bitio.ReadFull(br, compressed, n*8); err != nil {
d.Fatalf("failed reading compressed data %v", err)