From 91e693724fd671acb1092f3df376305754cf3491 Mon Sep 17 00:00:00 2001 From: Harald Kuhr Date: Tue, 4 Nov 2014 16:15:55 +0100 Subject: [PATCH] TM-80: DecoderStream.skip now correctly skips the bytes it reports as skipped. --- .../src/main/java/com/twelvemonkeys/io/enc/DecoderStream.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/common-io/src/main/java/com/twelvemonkeys/io/enc/DecoderStream.java b/common/common-io/src/main/java/com/twelvemonkeys/io/enc/DecoderStream.java index b61ced3d..07826694 100644 --- a/common/common-io/src/main/java/com/twelvemonkeys/io/enc/DecoderStream.java +++ b/common/common-io/src/main/java/com/twelvemonkeys/io/enc/DecoderStream.java @@ -156,9 +156,9 @@ public final class DecoderStream extends FilterInputStream { } } - // NOTE: Skipped can never be more than avail, which is - // an int, so the cast is safe + // NOTE: Skipped can never be more than avail, which is an int, so the cast is safe int skipped = (int) Math.min(pLength - total, buffer.remaining()); + buffer.position(buffer.position() + skipped); total += skipped; }