Documentation ¶
Overview ¶
Package compress implements compressing and uncompressing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
Compressor defines the struct of compressor.
func (*Compressor) Compress ¶
func (c *Compressor) Compress(data []byte) []byte
Compress returns the compressed data.
func (*Compressor) Uncompress ¶
func (c *Compressor) Uncompress(data []byte) []byte
Uncompress returns the uncompressed data.
type Level ¶
type Level int
Level defines the level for compression. Higher levels typically run slower but compress more.
const ( //NoCompression does not attempt any compression. NoCompression Level = 0 //BestSpeed defines the level of best speed. BestSpeed Level = 1 //Level2 defines the level 2. Level2 Level = 2 //Level3 defines the level 3. Level3 Level = 3 //Level4 defines the level 4. Level4 Level = 4 //Level5 defines the level 5. Level5 Level = 5 //Level6 defines the level 6. Level6 Level = 6 //Level7 defines the level 7. Level7 Level = 7 //Level8 defines the level 8. Level8 Level = 8 //BestCompression defines the level of best compression. BestCompression Level = 9 //DefaultCompression uses the default compression level. DefaultCompression Level = -1 // HuffmanOnly will use Huffman compression only, giving // a very fast compression for all types of input, // but sacrificing considerable compression efficiency. HuffmanOnly Level = -2 )
Click to show internal directories.
Click to hide internal directories.