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

Method ResetWithOptions

zstd/decoder.go:240–249  ·  view source on GitHub ↗

ResetWithOptions will reset the decoder and apply the given options for the next stream or DecodeAll operation. Options are applied on top of the existing options. Some options cannot be changed on reset and will return an error.

(r io.Reader, opts ...DOption)

Source from the content-addressed store, hash-verified

238// Options are applied on top of the existing options.
239// Some options cannot be changed on reset and will return an error.
240func (d *Decoder) ResetWithOptions(r io.Reader, opts ...DOption) error {
241 d.o.resetOpt = true
242 defer func() { d.o.resetOpt = false }()
243 for _, o := range opts {
244 if err := o(&d.o); err != nil {
245 return err
246 }
247 }
248 return d.Reset(r)
249}
250
251// drainOutput will drain the output until errEndOfStream is sent.
252func (d *Decoder) drainOutput() {

Calls 1

ResetMethod · 0.95