Provides a low-level interface to the compress/gzip package.
Package gzip implements reading and writing of gzip format compressed files,
as specified in RFC 1952.
ConstantsConstants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.
ErrChecksumGoVar of *error v1.0
ErrChecksum is returned when reading GZIP data that has an invalid checksum.
ErrHeaderGoVar of *error v1.0
ErrHeader is returned when reading GZIP data that has an invalid header.
Functions, Macros, and Special Forms
NewReader creates a new Reader reading the given reader.
If r does not also implement io.ByteReader,
the decompressor may read more data than necessary from r.
It is the caller's responsibility to call Close on the Reader when done.
The Reader.Header fields will be valid in the Reader returned.
Go input arguments: (r io.Reader)
Go return type: (*Reader, error)
Joker input arguments: [^go.std.io/Reader r]
Joker return type: [(ref-to go.std.compress.gzip/Reader) Error]
NewWriter returns a new Writer.
Writes to the returned writer are compressed and written to w.
It is the caller's responsibility to call Close on the Writer when done.
Writes may be buffered and not flushed until Close.
Callers that wish to set the fields in Writer.Header must do so before
the first call to Write, Flush, or Close.
Go input arguments: (w io.Writer)
Go return type: *Writer
Joker input arguments: [^go.std.io/Writer w]
Joker return type: (ref-to go.std.compress.gzip/Writer)
(NewWriterLevel w level)
NewWriterLevel is like NewWriter but specifies the compression level instead
of assuming DefaultCompression.
The compression level can be DefaultCompression, NoCompression, HuffmanOnly
or any integer value between BestSpeed and BestCompression inclusive.
The error returned will be nil if the level is valid.
Go input arguments: (w io.Writer, level int)
Go return type: (*Writer, error)
Joker input arguments: [^go.std.io/Writer w, ^Int level]
Joker return type: [(ref-to go.std.compress.gzip/Writer) Error]
*HeaderConcrete GoType v1.0
*ReaderConcrete GoType v1.0
CloseReceiver for *Reader v1.0
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.
*WriterConcrete GoType v1.0
CloseReceiver for *Writer v1.0
Close closes the Writer by flushing any unwritten data to the underlying
io.Writer and writing the GZIP footer.
It does not close the underlying io.Writer.
FlushReceiver for *Writer v1.0
Flush flushes any pending compressed data to the underlying writer.
It is useful mainly in compressed network protocols, to ensure that
a remote reader has enough data to reconstruct a packet. Flush does
not return until the data has been written. If the underlying
writer returns an error, Flush returns that error.
In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH.
HeaderConcrete GoType v1.0
The gzip file stores a header giving metadata about the compressed file.
That header is exposed as the fields of the Writer and Reader structs.
Strings must be UTF-8 encoded and may only contain Unicode code points
U+0001 through U+00FF, due to limitations of the GZIP file format.
ReaderConcrete GoType v1.0
A Reader is an io.Reader that can be read to retrieve
uncompressed data from a gzip-format compressed file.
In general, a gzip file can be a concatenation of gzip files,
each with its own header. Reads from the Reader
return the concatenation of the uncompressed data of each.
Only the first header is recorded in the Reader fields.
Gzip files store a length and checksum of the uncompressed data.
The Reader will return an ErrChecksum when Read
reaches the end of the uncompressed data if it does not
have the expected length or checksum. Clients should treat data
returned by Read as tentative until they receive the io.EOF
marking the end of the data.
WriterConcrete GoType v1.0
A Writer is an io.WriteCloser.
Writes to a Writer are compressed and written to w.