Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrChecksum is returned when reading ZLIB data that has an invalid checksum. ErrChecksum = errors.New("zlib: invalid checksum") // ErrDictionary is returned when reading ZLIB data that has an invalid dictionary. ErrDictionary = errors.New("zlib: invalid dictionary") // ErrHeader is returned when reading ZLIB data that has an invalid header. ErrHeader = errors.New("zlib: invalid header") )
Functions ¶
This section is empty.
Types ¶
type Inflator ¶
type Inflator struct {
// contains filtered or unexported fields
}
func NewInflator ¶
func NewInflator() *Inflator
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
NewReader creates a new ReadCloser. Reads from the returned ReadCloser read and decompress data from r. The implementation buffers input and may read more data than necessary from r. It is the caller's responsibility to call Close on the ReadCloser when done.
The ReadCloser returned by NewReader also implements Resetter.
func NewReaderDict ¶
NewReaderDict is like NewReader but uses a preset dictionary. NewReaderDict ignores the dictionary if the compressed data does not refer to it. If the compressed data refers to a different dictionary, NewReaderDict returns ErrDictionary.
The ReadCloser returned by NewReaderDict also implements Resetter.
func (*Reader) Close ¶
Calling Close does not close the wrapped io.Reader originally passed to NewReader.
func (*Reader) SwapReader ¶
type Resetter ¶
type Resetter interface { // Reset discards any buffered data and resets the Resetter as if it was // newly initialized with the given reader. Reset(r io.Reader, dict []byte) error }
Resetter resets a ReadCloser returned by NewReader or NewReaderDict to to switch to a new underlying Reader. This permits reusing a ReadCloser instead of allocating a new one.