TM-80: DecoderStream.skip now correctly skips the bytes it reports as skipped.

This commit is contained in:
Harald Kuhr 2014-11-04 16:15:55 +01:00
parent 36204f378d
commit 91e693724f

View File

@ -156,9 +156,9 @@ public final class DecoderStream extends FilterInputStream {
} }
} }
// NOTE: Skipped can never be more than avail, which is // NOTE: Skipped can never be more than avail, which is an int, so the cast is safe
// an int, so the cast is safe
int skipped = (int) Math.min(pLength - total, buffer.remaining()); int skipped = (int) Math.min(pLength - total, buffer.remaining());
buffer.position(buffer.position() + skipped);
total += skipped; total += skipped;
} }