mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2026-02-02 00:00:05 +08:00
CB-5631 Removed 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.
This commit is contained in:
committed by
Andrew Grieve
parent
3c1ff16064
commit
8374b3dd67
@@ -158,11 +158,8 @@ public class FileTransfer extends CordovaPlugin {
|
||||
return updateBytesRead(super.read());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] buffer) throws IOException {
|
||||
return updateBytesRead(super.read(buffer));
|
||||
}
|
||||
|
||||
// Note: FilterInputStream delegates read(byte[] bytes) to the below method,
|
||||
// so we don't override it or else double count (CB-5631).
|
||||
@Override
|
||||
public int read(byte[] bytes, int offset, int count) throws IOException {
|
||||
return updateBytesRead(super.read(bytes, offset, count));
|
||||
|
||||
Reference in New Issue
Block a user