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
| 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. |
| 22 | type 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. |
nothing calls this directly
no outgoing calls
no test coverage detected