Documentation
¶
Overview ¶
Package zipstream provides support for reading ZIP archives through an io.Reader.
Zip64 archives are not yet supported.
Index ¶
Constants ¶
const ( Store uint16 = 0 // no compression Deflate uint16 = 8 // DEFLATE compressed )
Compression methods.
Variables ¶
This section is empty.
Functions ¶
func RegisterDecompressor ¶
func RegisterDecompressor(method uint16, dcomp Decompressor)
RegisterDecompressor allows custom decompressors for a specified method ID. The common methods Store and Deflate are built in.
Types ¶
type Decompressor ¶
type Decompressor func(r io.Reader) io.ReadCloser
A Decompressor returns a new decompressing reader, reading from r. The ReadCloser's Close method must be used to release associated resources. The Decompressor itself must be safe to invoke from multiple goroutines simultaneously, but each returned reader will be used only by one goroutine at a time.
type Reader ¶
A Reader provides sequential access to the contents of a zip archive. A zip archive consists of a sequence of files, The Next method advances to the next file in the archive (including the first), and then it can be treated as an io.Reader to access the file's data. The Buffered method recovers any bytes read beyond the end of the zip file, necessary if you plan to process anything after it that is not another zip file.