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

BufferedSink.write(Source, long) hides bugs #105

Closed
JakeWharton opened this issue Jan 5, 2015 · 1 comment · Fixed by #124
Closed

BufferedSink.write(Source, long) hides bugs #105

JakeWharton opened this issue Jan 5, 2015 · 1 comment · Fixed by #124
Labels
Milestone

Comments

@JakeWharton
Copy link
Member

It calls source.read(buffer, byteCount) which might not read byteCount bytes and also might return -1 (which is ignored).

Our API should make it hard to write buggy code, and this one tripped me up forcing use of the inverse API which correctly reported read count.

@akhilc1
Copy link

akhilc1 commented Feb 9, 2015

Yeah, I got this issue regardless of whatever I give for byteCount only 2kb of data gets written/read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants