MCPcopy Create free account
hub / github.com/brimdata/super / writeCompHeader

Method writeCompHeader

sio/bsupio/writer.go:183–193  ·  view source on GitHub ↗
(blockType, size, zlen int)

Source from the content-addressed store, hash-verified

181}
182
183func (w *Writer) writeCompHeader(blockType, size, zlen int) error {
184 zlen += 1 + scode.SizeOfUvarint(uint64(size))
185 version := BSUPVersion | 0x80
186 code := (blockType << 4) | (zlen & 0xf) | 0x40
187 w.header = append(w.header[:0], byte(version))
188 w.header = append(w.header, byte(code))
189 w.header = binary.AppendUvarint(w.header, uint64(zlen>>4))
190 w.header = append(w.header, byte(CompressionFormatLZ4))
191 w.header = binary.AppendUvarint(w.header, uint64(size))
192 return w.write(w.header)
193}
194
195type compressor struct {
196 compressor lz4.Compressor

Callers 1

writeBlockMethod · 0.95

Calls 2

writeMethod · 0.95
SizeOfUvarintFunction · 0.92

Tested by

no test coverage detected