Namespace: go.std.compress.lzw
v1.0Contents
Summary
Provides a low-level interface to the compress/lzw package.
Package lzw implements the Lempel-Ziv-Welch compressed data format,
described in T. A. Welch, “A Technique for High-Performance Data
Compression”, Computer, 17(6) (June 1984), pp 8-19.
In particular, it implements LZW as used by the GIF and PDF file
formats, which means variable-width codes up to 12 bits and the first
two non-literal codes are a clear code and an EOF code.
The TIFF file format uses a similar but incompatible version of the LZW
algorithm. See the golang.org/x/image/tiff/lzw package for an
implementation.
Index
- *Order
- *Reader
- *Writer
- LSB
- MSB
- NewReader
- NewWriter
- Order
- Reader
- Writer
- arrayOfOrder
- arrayOfReader
- arrayOfWriter
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
LSB
GoObject v1.0LSB means Least Significant Bits first, as used in the GIF file format.
-
MSB
GoObject v1.0MSB means Most Significant Bits first, as used in the TIFF and PDF
file formats.
Functions, Macros, and Special Forms
-
NewReader
Function v1.0(NewReader r order litWidth)
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.
The number of bits to use for literal codes, litWidth, must be in the
range [2,8] and is typically 8. It must equal the litWidth
used during compression.
It is guaranteed that the underlying type of the returned io.ReadCloser
is a *Reader.
Go input arguments: (r io.Reader, order Order, litWidth int)
Go returns: io.ReadCloser
Joker input arguments: [^go.std.io/Reader r, ^Order order, ^Int litWidth]
Joker returns: ^go.std.io/ReadCloser -
NewWriter
Function v1.0(NewWriter w order litWidth)
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.
The number of bits to use for literal codes, litWidth, must be in the
range [2,8] and is typically 8. Input bytes must be less than 1<<litWidth.
It is guaranteed that the underlying type of the returned io.WriteCloser
is a *Writer.
Go input arguments: (w io.Writer, order Order, litWidth int)
Go returns: io.WriteCloser
Joker input arguments: [^go.std.io/Writer w, ^Order order, ^Int litWidth]
Joker returns: ^go.std.io/WriteCloser
Types
-
*Order
Concrete Type v1.0Order specifies the bit ordering in an LZW data stream.
-
*Reader
Concrete Type v1.0Reader is an io.Reader which can be used to read compressed data in the
LZW format.
-
Close
Receiver for *Reader v1.0([])
Close closes the Reader and returns an error for any future read operation.
It does not close the underlying io.Reader.
-
Read
Receiver for *Reader v1.0([b])
Read implements io.Reader, reading uncompressed bytes from its underlying Reader.
-
Reset
Receiver for *Reader v1.0([src order litWidth])
Reset clears the Reader's state and allows it to be reused again
as a new Reader.
-
*Writer
Concrete Type v1.0Writer is an LZW compressor. It writes the compressed form of the data
to an underlying writer (see NewWriter).
-
Close
Receiver for *Writer v1.0([])
Close closes the Writer, flushing any pending output. It does not close
w's underlying writer.
-
Reset
Receiver for *Writer v1.0([dst order litWidth])
Reset clears the Writer's state and allows it to be reused again
as a new Writer.
-
Write
Receiver for *Writer v1.0([p])
Write writes a compressed representation of p to w's underlying writer.
-
Order
Concrete Type v1.0Order specifies the bit ordering in an LZW data stream.
-
Reader
Concrete Type v1.0Reader is an io.Reader which can be used to read compressed data in the
LZW format.
-
Writer
Concrete Type v1.0Writer is an LZW compressor. It writes the compressed form of the data
to an underlying writer (see NewWriter).
-
arrayOfOrder
Concrete Type v1.0Order specifies the bit ordering in an LZW data stream.
-
arrayOfReader
Concrete Type v1.0Reader is an io.Reader which can be used to read compressed data in the
LZW format.
-
arrayOfWriter
Concrete Type v1.0Writer is an LZW compressor. It writes the compressed form of the data
to an underlying writer (see NewWriter).