Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compress/lzw: Reader behaviour changes for ByteReader #8309

Closed
PieterD opened this issue Jul 1, 2014 · 4 comments
Closed

compress/lzw: Reader behaviour changes for ByteReader #8309

PieterD opened this issue Jul 1, 2014 · 4 comments

Comments

@PieterD
Copy link
Contributor

PieterD commented Jul 1, 2014

An lzw reader has dfferent behaviour whether the underlying reader is an io.ByteReader
or not.

http://play.golang.org/p/Z9ngQcpn8k

I was bitten by this when my tests used a bytes.Buffer (as in the provided code), but
the real code used an os.File.

The problem is that lzw.NewReader wraps the Reader in a bufio.Reader if the underlying
reader is not already a ByteReader. This bufio.Reader reads bytes following the
compressed data from the underlying Reader due to buffering, while the ByteReader does
not.

I'm not sure if this should be fixed, or merely documented.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.4.

@rsc
Copy link
Contributor

rsc commented Sep 15, 2014

Comment 2:

Labels changed: added documentation.

Status changed to Accepted.

@gopherbot
Copy link
Contributor

Comment 3:

CL https://golang.org/cl/147380043 mentions this issue.

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 4:

This issue was closed by revision a6abe22.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
Fixes golang#8309.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/147380043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
Fixes golang#8309.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/147380043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
Fixes golang#8309.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/147380043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
Fixes golang#8309.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/147380043
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants