package gzip
Import Path
compress/gzip (on golang.org and go.dev)
Dependency Relation
imports 8 packages, and imported by one package
Involved Source Files
d-> gunzip.go
gzip.go
Exported Type Names
Exported Values
const
BestCompression = 9
These constants are copied from the flate package, so that code that imports
"compress/gzip" does not also have to import "compress/flate".
const
BestSpeed = 1
These constants are copied from the flate package, so that code that imports
"compress/gzip" does not also have to import "compress/flate".
const
DefaultCompression = -1
These constants are copied from the flate package, so that code that imports
"compress/gzip" does not also have to import "compress/flate".
var
ErrChecksum error
ErrChecksum is returned when reading GZIP data that has an invalid checksum.
const
HuffmanOnly = -2
These constants are copied from the flate package, so that code that imports
"compress/gzip" does not also have to import "compress/flate".
func
NewReader(r
io.
Reader) (*
Reader,
error)
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.
func
NewWriter(w
io.
Writer) *
Writer
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.
func
NewWriterLevel(w
io.
Writer, level
int) (*
Writer,
error)
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.
const
NoCompression = 0
These constants are copied from the flate package, so that code that imports
"compress/gzip" does not also have to import "compress/flate".
 |
The pages are generated with Golds v0.1.6. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project and developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |