brotli

package
v0.0.0-...-5e6f499 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: BSD-3-Clause Imports: 7 Imported by: 2

Documentation

Overview

Package brotli implements the Brotli compressed data format, described in RFC 7932.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ReadyToSaveError is returned by Read() when a SaverReader is ready to emit a checkpoint
	ReadyToSaveError = baseErrors.New("ready to save")
	// NotOnBoundaryError is returned by Save() when a SaverReader wasn't ready to emit a checkpoint
	NotOnBoundaryError = baseErrors.New("asked to save, but not on boundary")
)

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	InputOffset  int64 // Total number of bytes read from underlying io.Reader
	OutputOffset int64 // Total number of bytes emitted from Read

	BitReaderBufBits uint64
	BitReaderNumBits uint

	Dists []int

	DictSize  int
	DictHist  []byte
	DictWrPos int
	DictRdPos int
	DictFull  bool
}

func (*Checkpoint) Resume

func (c *Checkpoint) Resume(r io.Reader) (SaverReader, error)

type Reader

type Reader struct {
	InputOffset  int64 // Total number of bytes read from underlying io.Reader
	OutputOffset int64 // Total number of bytes emitted from Read
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader, conf *ReaderConfig) (*Reader, error)

func (*Reader) Close

func (br *Reader) Close() error

func (*Reader) Read

func (br *Reader) Read(buf []byte) (int, error)

func (*Reader) Reset

func (br *Reader) Reset(r io.Reader) error

type ReaderConfig

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

type Saver

type Saver interface {
	WantSave()
	Save() (*Checkpoint, error)
}

type SaverReader

type SaverReader interface {
	io.ReadCloser
	Saver
}

func NewSaverReader

func NewSaverReader(r io.Reader) (SaverReader, error)

Jump to

Keyboard shortcuts

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