lzw

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package lzw is an enhanced version of compress/lzw.

It implements Adobe's PDF lzw compression as defined for the LZWDecode filter and is also compatible with the TIFF file format.

See the golang proposal: https://github.com/golang/go/issues/25409.

More information: https://github.com/pdfcpu/pdfcpu/tree/master/internal/filter/lzw

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(r io.Reader, oneOff bool) io.ReadCloser

NewReader creates a new io.ReadCloser. Reads from the returned io.ReadCloser read and decompress data from r. If r does not also implement io.ByteReader, the decompressor may read more data than necessary from r. It is the caller's responsibility to call Close on the ReadCloser when finished reading. oneOff makes code length increases occur one code early. It should be true for LZWDecode filters with earlyChange=1 which is also the default.

func NewWriter

func NewWriter(w io.Writer, oneOff bool) io.WriteCloser

NewWriter creates a new io.WriteCloser. Writes to the returned io.WriteCloser are compressed and written to w. It is the caller's responsibility to call Close on the WriteCloser when finished writing. oneOff makes code length increases occur one code early. It should be true for LZWDecode filters with earlyChange=1 which is also the default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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