Lines Matching refs:Reader
48 // That header is exposed as the fields of the Writer and Reader structs.
60 // A Reader is an io.Reader that can be read to retrieve
64 // each with its own header. Reads from the Reader
66 // Only the first header is recorded in the Reader fields.
69 // The Reader will return a ErrChecksum when Read
74 type Reader struct {
75 Header // valid after NewReader or Reader.Reset
76 r flate.Reader
85 // NewReader creates a new Reader reading the given reader.
89 // It is the caller's responsibility to call Close on the Reader when done.
91 // The Reader.Header fields will be valid in the Reader returned.
92 func NewReader(r io.Reader) (*Reader, error) {
93 z := new(Reader)
100 // Reset discards the Reader z's state and makes it equivalent to the
102 // This permits reusing a Reader rather than allocating a new one.
103 func (z *Reader) Reset(r io.Reader) error {
104 *z = Reader{
108 if rr, ok := r.(flate.Reader); ok {
117 // Multistream controls whether the reader supports multistream files.
119 // If enabled (the default), the Reader expects the input to be a sequence
128 // In this mode, when the Reader reaches the end of the data stream,
129 // Read returns io.EOF. If the underlying reader implements io.ByteReader,
133 func (z *Reader) Multistream(ok bool) {
141 func (z *Reader) readString() (string, error) {
174 func (z *Reader) readHeader() (hdr Header, err error) {
245 // Read implements io.Reader, reading uncompressed bytes from its underlying Reader.
246 func (z *Reader) Read(p []byte) (n int, err error) {
289 // Close closes the Reader. It does not close the underlying io.Reader.
290 // In order for the GZIP checksum to be verified, the reader must be
292 func (z *Reader) Close() error { return z.decompressor.Close() }