1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Merge pull request #52 from andrewgaul/peekable-bad-offset

Fix bad offset in PeekableInputStream
This commit is contained in:
Jesse Vincent 2011-09-28 21:10:41 -07:00
commit fd61b4f20b

View File

@ -41,7 +41,7 @@ public class PeekableInputStream extends InputStream {
if (!mPeeked) { if (!mPeeked) {
return mIn.read(b, offset, length); return mIn.read(b, offset, length);
} else { } else {
b[0] = (byte)mPeekedByte; b[offset] = (byte)mPeekedByte;
mPeeked = false; mPeeked = false;
int r = mIn.read(b, offset + 1, length - 1); int r = mIn.read(b, offset + 1, length - 1);
if (r == -1) { if (r == -1) {