cgolz4

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cgolz4 wraps the C "lz4" library.

It speaks the LZ4 frame format, not the LZ4 block format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader decompresses from the lz4 format.

The zero value is not usable until Reset is called.

func (*Reader) Close

func (r *Reader) Close() error

Close implements compression.Reader.

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

Read implements compression.Reader.

func (*Reader) Reset

func (r *Reader) Reset(reader io.Reader, dictionary []byte) error

Reset implements compression.Reader.

type ReaderRecycler

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

ReaderRecycler can lessen the new memory allocated when calling Reader.Reset on a bound Reader.

It is not safe to use a ReaderRecycler and a Reader concurrently.

func (*ReaderRecycler) Bind

func (c *ReaderRecycler) Bind(r *Reader)

Bind lets r re-use the memory that is manually managed by c. Call c.Close to free that memory.

func (*ReaderRecycler) Close

func (c *ReaderRecycler) Close() error

Close implements io.Closer.

type Writer

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

Writer compresses to the lz4 format.

Compressed bytes may be buffered and not sent to the underlying io.Writer until Close is called.

The zero value is not usable until Reset is called.

func (*Writer) Close

func (w *Writer) Close() error

Close implements compression.Writer.

func (*Writer) Reset

func (w *Writer) Reset(writer io.Writer, dictionary []byte, level compression.Level) error

Reset implements compression.Writer.

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Write implements compression.Writer.

type WriterRecycler

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

WriterRecycler can lessen the new memory allocated when calling Writer.Reset on a bound Writer.

It is not safe to use a WriterRecycler and a Writer concurrently.

func (*WriterRecycler) Bind

func (c *WriterRecycler) Bind(w *Writer)

Bind lets w re-use the memory that is manually managed by c. Call c.Close to free that memory.

func (*WriterRecycler) Close

func (c *WriterRecycler) Close() error

Close implements io.Closer.

Jump to

Keyboard shortcuts

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