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

CB-5631: Progress loaded count in Android #14

Closed
wants to merge 1 commit into from

Conversation

cdmahoney
Copy link
Contributor

@cdmahoney cdmahoney commented Jan 10, 2014

SimpleTrackingInputStream.getTotalRawBytesRead returns twice the number of bytes actually read.

InputStream.read(byte[] buffer) calls InputStream.read(byte[] bytes, int offset, int count). As SimpleTrackingInputStream overrides both these methods a call to SimpleTrackingInputStream.read(byte[] buffer) results in a call to SimpleTrackingInputStream.read(byte[] bytes, int offset, int count) - and two calls to SimpleTrackingInputStream.updateBytesRead, so the counter bytesRead gets incremented twice for each read.

This change removes the implementation of SimpleTrackingInputStream.read(byte[] buffer).

InputStream.read(byte[] buffer) calls InputStream.read(byte[] bytes, int
offset, int count).  As SimpleTrackingInputStream overrides both these
methods a call to SimpleTrackingInputStream.read(byte[] buffer) results
in a call to SimpleTrackingInputStream.read(byte[] bytes, int offset,
int count) - and two calls to SimpleTrackingInputStream.updateBytesRead,
so the counter bytesRead gets incremented twice for each read.
@agrieve
Copy link
Contributor

@agrieve agrieve commented Jan 10, 2014

Thanks for the fix! I've merged in your change:

https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file-transfer.git;h=8374b3d

Please close the pull request.

@cdmahoney cdmahoney closed this Jan 10, 2014
@cdmahoney
Copy link
Contributor Author

@cdmahoney cdmahoney commented Jan 10, 2014

Done - thanks!

Colin

On Fri, Jan 10, 2014 at 6:20 PM, agrieve notifications@github.com wrote:

Thanks for the fix! I've merged in your change:

https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file-transfer.git;h=8374b3d

Please close the pull request.


Reply to this email directly or view it on GitHubhttps://github.com//pull/14#issuecomment-32046790
.

Colin Mahoney
cdmahoney@gmail.com

Monistrol de Montserrat

Catalunya

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

Successfully merging this pull request may close these issues.

None yet

2 participants