Documentation
¶
Index ¶
Constants ¶
const DefaultIndexInterval = 1024 * 1024 // 1 MB
DefaultIndexInterval is how often the reader will save decompressor state by default.
Variables ¶
var ( // ErrInvalidSeek is returned if attempting to seek prior to beginning of the file. ErrInvalidSeek = errors.New("zseek: attempting to seek before beginning of file") // ErrUnimplementedSeek is returned if attempting to seek from the end of the file. ErrUnimplementedSeek = errors.New("zseek: seek from SeekEnd is not implemented") )
Functions ¶
This section is empty.
Types ¶
type DReader ¶
type DReader struct {
Index // valid after NewReader
// contains filtered or unexported fields
}
A Reader is an io.Reader that can be read to retrieve uncompressed data from a raw deflated (compressed) file, from a ZIP archive.
Clients should treat data returned by Read as tentative until they receive the io.EOF marking the end of the data.
func NewDReader ¶
func NewDReader(r io.ReadSeeker) (*DReader, error)
func NewDReaderInterval ¶
func NewDReaderInterval(r io.ReadSeeker, indexInterval int64) (*DReader, error)
func (*DReader) Close ¶
Close closes the Reader. It does not close the underlying io.Reader. In order for the GZIP checksum to be verified, the reader must be fully consumed until the io.EOF.
func (*DReader) Read ¶
Read implements io.Reader, reading uncompressed bytes from its underlying Reader.
func (*DReader) Seek ¶
Seek implements io.Seeker. The gzip file will be decompressed as needed to seek forward, building an index of offsets as it does so. Subsequent calls to seek will use the index to skip data more efficiently. Seeking from the end of the file is not implemented and will return ErrUnimplementedSeek.