mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -05:00
FixedLengthInputStream - increment mCount only when read() succeeds
Patch by andrewgaul
This commit is contained in:
parent
969277f619
commit
e145a621c7
@ -27,8 +27,11 @@ public class FixedLengthInputStream extends InputStream {
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
if (mCount < mLength) {
|
||||
mCount++;
|
||||
return mIn.read();
|
||||
int d = mIn.read();
|
||||
if (d != -1) {
|
||||
mCount++;
|
||||
}
|
||||
return d;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user