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

Function WithEncoderDictRaw

zstd/encoder_options.go:398–406  ·  view source on GitHub ↗

WithEncoderDictRaw registers a dictionary that may be used by the encoder. The slice content may contain arbitrary data. It will be used as an initial history. Can be changed with ResetWithOptions.

(id uint32, content []byte)

Source from the content-addressed store, hash-verified

396// history.
397// Can be changed with ResetWithOptions.
398func WithEncoderDictRaw(id uint32, content []byte) EOption {
399 return func(o *encoderOptions) error {
400 if bits.UintSize > 32 && uint(len(content)) > dictMaxLength {
401 return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content))
402 }
403 o.dict = &dict{id: id, content: content, offsets: [3]int{1, 4, 8}}
404 return nil
405 }
406}
407
408// WithEncoderDictDelete clears the dictionary, so no dictionary will be used.
409// Should be used with ResetWithOptions.

Callers 4

TestEncoderDictDeleteFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestEncoderDictDeleteFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…