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

Method readComp

cmd/super/dev/dig/frames/command.go:195–221  ·  view source on GitHub ↗
(code byte)

Source from the content-addressed store, hash-verified

193}
194
195func (r *reader) readComp(code byte) (any, error) {
196 zlen, err := r.readLength(code)
197 if err != nil {
198 return nil, err
199 }
200 format, err := r.ReadByte()
201 if err != nil {
202 return nil, err
203 }
204 size, err := r.readUvarint()
205 if err != nil {
206 return nil, err
207 }
208 // The size of the compressed buffer needs to be adjusted by the
209 // byte for the format and the variable-length bytes to encode
210 // the original size.
211 zlen -= 1 + scode.SizeOfUvarint(uint64(size))
212 err = r.skip(zlen)
213 if err != nil && err != io.EOF {
214 }
215 return &CompressedBlock{
216 Type: "compressed",
217 Length: int64(zlen),
218 Format: int8(format),
219 Size: int64(size),
220 }, nil
221}
222
223func (r *reader) skip(n int) error {
224 if n > 25*1024*1024 {

Callers 1

nextFrameMethod · 0.80

Calls 5

readLengthMethod · 0.95
ReadByteMethod · 0.95
readUvarintMethod · 0.95
skipMethod · 0.95
SizeOfUvarintFunction · 0.92

Tested by

no test coverage detected