MCPcopy
hub / github.com/klauspost/compress / Decoder

Struct Decoder

zstd/decoder.go:22–44  ·  view source on GitHub ↗

Decoder provides decoding of zstandard streams. The decoder has been designed to operate without allocations after a warmup. This means that you should store the decoder for best performance. To re-use a stream decoder, use the Reset(r io.Reader) error to switch to another stream. A decoder can safe

Source from the content-addressed store, hash-verified

20// A decoder can safely be re-used even if the previous stream failed.
21// To release the resources, you must call the Close() function on a decoder.
22type Decoder struct {
23 o decoderOptions
24
25 // Unreferenced decoders, ready for use.
26 decoders chan *blockDec
27
28 // Current read position used for Reader functionality.
29 current decoderState
30
31 // sync stream decoding
32 syncStream struct {
33 decodedFrame uint64
34 br readerWrapper
35 enabled bool
36 inFrame bool
37 dstBuf []byte
38 }
39
40 frame *frameDec
41
42 // streamWg is the waitgroup for all streams
43 streamWg sync.WaitGroup
44}
45
46// decoderState is used for maintaining state when the decoder
47// is used for streaming.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected