zip

package
v0.0.0-...-1941b44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(in []byte, charset string) ([]byte, error)

Decode convert code point

func GetEncoding

func GetEncoding(charset string) (encoding.Encoding, bool)

GetEncoding get encoding

func Matched

func Matched(buf []byte) bool

Matched magic

Types

type CompressionMethod

type CompressionMethod uint16

CompressionMethod compress method see https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

const (
	Store   CompressionMethod = 0
	Deflate CompressionMethod = 8
	BZIP2   CompressionMethod = 12
	LZMA    CompressionMethod = 14
	LZMA2   CompressionMethod = 33
	ZSTD    CompressionMethod = 93
	XZ      CompressionMethod = 95
	JPEG    CompressionMethod = 96
	WavPack CompressionMethod = 97
	PPMd    CompressionMethod = 98
	AES     CompressionMethod = 99
)

CompressionMethod value

type Extractor

type Extractor struct {
	// contains filtered or unexported fields
}

Extractor todo

func NewExtractor

func NewExtractor(fd *os.File, eo *foundation.ExtractOptions) (*Extractor, error)

NewExtractor new extractor

func (*Extractor) Close

func (e *Extractor) Close() error

Close fd

func (*Extractor) DecodeFileName

func (e *Extractor) DecodeFileName(header zip.FileHeader) string

DecodeFileName decode filename

func (*Extractor) Extract

func (e *Extractor) Extract(destination string) error

Extract file

func (*Extractor) Statistics

func (e *Extractor) Statistics() error

Statistics todo

type Resetter

type Resetter interface {
	// Reset discards any buffered data and resets the Resetter as if it was
	// newly initialized with the given reader.
	Reset(r io.Reader) error
}

Resetter resets a ReadCloser returned by NewReader or NewReaderDict to switch to a new underlying Reader. This permits reusing a ReadCloser instead of allocating a new one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL