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)
| 396 | // history. |
| 397 | // Can be changed with ResetWithOptions. |
| 398 | func 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. |
no outgoing calls
searching dependent graphs…