git.lucas.co / go_mono
git clone https://git.lucas.co/go_mono.git

commitef56035c4be2963075510a62b88c2a16461e49e6
parent090ed236cf
authorNigel Tao <[email protected]>
date2015-06-22 10:44
tiff/lzw: sync to the upstream lzw in the stdlib.

Change-Id: If6086ada81498327c61e91b18d135aa255401e68
Reviewed-on: https://go-review.googlesource.com/11320
Reviewed-by: David Symonds <[email protected]>

 tiff/lzw/reader.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tiff/lzw/reader.go b/tiff/lzw/reader.go
index 13c635a..371adb0 100644
--- a/tiff/lzw/reader.go
+++ b/tiff/lzw/reader.go
@@ -237,10 +237,13 @@ func (d *decoder) Close() error {
 
 // 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.
+// range [2,8] and is typically 8. It must equal the litWidth
+// used during compression.
 func NewReader(r io.Reader, order Order, litWidth int) io.ReadCloser {
 	d := new(decoder)
 	switch order {