SnappyInputStream didn't count bytes read when sliding the window
may be related to
@@ -168,6 +168,7 @@ private void fill(final int len) throws IOException {
case 0x00:
length = readLiteralLength(b);
+ uncompressedBytesRemaining -= length;
if (expandLiteral(length)) {
return;
@@ -186,6 +187,7 @@ private void fill(final int len) throws IOException {
*/
length = 4 + ((b >> 2) & 0x07);
+ uncompressedBytesRemaining -= length;
offset = (b & 0xE0) << 3;
offset |= readOneByte();
@@ -205,6 +207,7 @@ private void fill(final int len) throws IOException {
*/
length = (b >> 2) + 1;
+ uncompressedBytesRemaining -= length;
offset = readOneByte();
offset |= readOneByte() << 8;
@@ -224,6 +227,7 @@ private void fill(final int len) throws IOException {
*/
length = (b >> 2) + 1;
+ uncompressedBytesRemaining -= length;
offset = readOneByte();
offset |= readOneByte() << 8;
@@ -237,7 +241,6 @@ private void fill(final int len) throws IOException {
}
readNow -= length;
- uncompressedBytesRemaining -= length;
}
}
