Documentation ¶
Overview ¶
Package pbzip2 is a wrapper around the pbzip2 command. If it's present on the system, this library will use it for higher performance when decompressing bzip2 data.
Index ¶
Constants ¶
View Source
const ( // Command is the pbzip2 command Command = "pbzip2" // BestSpeed represents the smallest block size (100k) BestSpeed = 1 // BestCompression represents the largest block size (900k) BestCompression = 9 // DefaultCompression represents the default block size (900k) DefaultCompression = 9 )
Variables ¶
This section is empty.
Functions ¶
func NewReader ¶
func NewReader(r io.Reader) (io.ReadCloser, error)
NewReader creates a new pbzip2 reader. This will print a warning if pbzip2 is not present on the system and return a stdlib bzip2.Reader instead.
func NewWriter ¶
func NewWriter(w io.Writer) (io.WriteCloser, error)
NewWriter creates a new pbzip2 writer. This will return an error if pbzip2 is not present on the system.
func NewWriterConfig ¶
func NewWriterConfig(w io.Writer, conf *WriterConfig) (io.WriteCloser, error)
NewWriterConfig creates a new pbzip2 writer with configuration options. This will return an error if pbzip2 is not present on the system.
Types ¶
type WriterConfig ¶
type WriterConfig struct {
Level int
}
WriterConfig stores configuration options for a pbzip2 writer
Click to show internal directories.
Click to hide internal directories.