diff options
Diffstat (limited to 'libgo/go/compress/lzw/reader.go')
-rw-r--r-- | libgo/go/compress/lzw/reader.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libgo/go/compress/lzw/reader.go b/libgo/go/compress/lzw/reader.go index efbc758f94..526620c827 100644 --- a/libgo/go/compress/lzw/reader.go +++ b/libgo/go/compress/lzw/reader.go @@ -6,12 +6,16 @@ // 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, TIFF and PDF file +// 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. package lzw -// TODO(nigeltao): check that TIFF and PDF use LZW in the same way as GIF, +// TODO(nigeltao): check that PDF uses LZW in the same way as GIF, // modulo LSB/MSB packing order. import ( @@ -216,8 +220,10 @@ func (d *decoder) Close() error { return nil } -// NewReader creates a new io.ReadCloser that satisfies reads by decompressing -// the data read from r. +// 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 |