Versions in this module Expand all Collapse all v0 v0.0.2 Nov 6, 2023 Changes in this version + const HeaderMaxSize + const MaxWindowSize + const MinWindowSize + const ZipMethodPKWare + const ZipMethodWinZip + var ErrBlockTooSmall = errors.New("block too small") + var ErrCRCMismatch = errors.New("CRC check failed") + var ErrCompressedSizeTooBig = errors.New("invalid input: compressed size too big") + var ErrDecoderClosed = errors.New("decoder used after Close") + var ErrDecoderNilInput = errors.New("nil input provided as reader") + var ErrDecoderSizeExceeded = errors.New("decompressed size exceeds configured limit") + var ErrFrameSizeExceeded = errors.New("frame size exceeded") + var ErrFrameSizeMismatch = errors.New("frame size does not match size on stream") + var ErrMagicMismatch = errors.New("invalid input: magic number mismatch") + var ErrReservedBlockType = errors.New("invalid input: reserved block type encountered") + var ErrSnappyCorrupt = errors.New("snappy: corrupt input") + var ErrSnappyTooLarge = errors.New("snappy: decoded block is too large") + var ErrSnappyUnsupported = errors.New("snappy: unsupported input") + var ErrUnexpectedBlockSize = errors.New("unexpected block size") + var ErrUnknownDictionary = errors.New("unknown dictionary") + var ErrWindowSizeExceeded = errors.New("window size exceeded") + var ErrWindowSizeTooSmall = errors.New("invalid input: window size was too small") + func BuildDict(o BuildDictOptions) ([]byte, error) + func InspectDictionary(b []byte) (interface{ ... }, error) + func ZipCompressor(opts ...EOption) func(w io.Writer) (io.WriteCloser, error) + func ZipDecompressor(opts ...DOption) func(r io.Reader) io.ReadCloser + type BuildDictOptions struct + CompatV155 bool + Contents [][]byte + DebugOut io.Writer + History []byte + ID uint32 + Level EncoderLevel + Offsets [3]int + type DOption func(*decoderOptions) error + func IgnoreChecksum(b bool) DOption + func WithDecodeAllCapLimit(b bool) DOption + func WithDecodeBuffersBelow(size int) DOption + func WithDecoderConcurrency(n int) DOption + func WithDecoderDictRaw(id uint32, content []byte) DOption + func WithDecoderDicts(dicts ...[]byte) DOption + func WithDecoderLowmem(b bool) DOption + func WithDecoderMaxMemory(n uint64) DOption + func WithDecoderMaxWindow(size uint64) DOption + type Decoder struct + func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) + func (d *Decoder) Close() + func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) + func (d *Decoder) IOReadCloser() io.ReadCloser + func (d *Decoder) Read(p []byte) (int, error) + func (d *Decoder) Read2(p []byte) (n int, cmprInfo common.CompressInfo, isNil bool, err error) + func (d *Decoder) Reset(r io.Reader) error + func (d *Decoder) WriteTo(w io.Writer) (int64, error) + type EOption func(*encoderOptions) error + func WithAllLitEntropyCompression(b bool) EOption + func WithEncoderCRC(b bool) EOption + func WithEncoderConcurrency(n int) EOption + func WithEncoderDict(dict []byte) EOption + func WithEncoderDictRaw(id uint32, content []byte) EOption + func WithEncoderLevel(l EncoderLevel) EOption + func WithEncoderPadding(n int) EOption + func WithLowerEncoderMem(b bool) EOption + func WithNoEntropyCompression(b bool) EOption + func WithSingleSegment(b bool) EOption + func WithWindowSize(n int) EOption + func WithZeroFrames(b bool) EOption + type Encoder struct + func NewWriter(w io.Writer, opts ...EOption) (*Encoder, error) + func (e *Encoder) Close() error + func (e *Encoder) EncodeAll(src, dst []byte) []byte + func (e *Encoder) Flush() error + func (e *Encoder) Flush2() (cmprInfo common.CompressInfo, err error) + func (e *Encoder) MaxEncodedSize(size int) int + func (e *Encoder) ReadFrom(r io.Reader) (n int64, err error) + func (e *Encoder) Reset(w io.Writer) + func (e *Encoder) ResetContentSize(w io.Writer, size int64) + func (e *Encoder) Write(p []byte) (n int, err error) + func (e *Encoder) Write2(p []byte) (n int, cmprInfo common.CompressInfo, isNil bool, err error) + type EncoderLevel int + const SpeedBestCompression + const SpeedBetterCompression + const SpeedDefault + const SpeedFastest + func EncoderLevelFromString(s string) (bool, EncoderLevel) + func EncoderLevelFromZstd(level int) EncoderLevel + func (e EncoderLevel) String() string + type Header struct + DictionaryID uint32 + FirstBlock struct{ ... } + FrameContentSize uint64 + HasCheckSum bool + HasFCS bool + HeaderSize int + SingleSegment bool + Skippable bool + SkippableID int + SkippableSize uint32 + WindowSize uint64 + func (h *Header) Decode(in []byte) error + type SnappyConverter struct + func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error)