gzip

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() compress.Interface

Initialize a new PGZip object based on the Interface interface

Types

type PGZip

type PGZip struct{}

func (PGZip) Decode

func (f PGZip) Decode(v *bytes.Buffer)

The Decode method will first decode and then overwrite the data in the input *bytes.Buffer.

func (PGZip) Encode

func (f PGZip) Encode(v []byte) (*bytes.Buffer, error)

Encode compresses the given bytes using pgzip compression, returning the compressed data in a new bytes.Buffer.

The reason why we choose pgzip instead of gzip is because it has special advantages when compressing large amounts of data. When the data block exceeds 1MB, pgzip will obtain a very considerable performance improvement.

Jump to

Keyboard shortcuts

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