From 798d6753ddeaebc8b1243b6291c9a68c43c7ca86 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 28 Nov 2011 01:14:49 +0100 Subject: [PATCH] FixedLengthInputStream - implement skip which honors mLength Patch by andrewgaul --- src/com/fsck/k9/mail/filter/FixedLengthInputStream.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/fsck/k9/mail/filter/FixedLengthInputStream.java b/src/com/fsck/k9/mail/filter/FixedLengthInputStream.java index 612b877ee..00e84a7cc 100644 --- a/src/com/fsck/k9/mail/filter/FixedLengthInputStream.java +++ b/src/com/fsck/k9/mail/filter/FixedLengthInputStream.java @@ -57,6 +57,15 @@ public class FixedLengthInputStream extends InputStream { return read(b, 0, b.length); } + @Override + public long skip(long n) throws IOException { + long d = mIn.skip(Math.min(n, available())); + if (d > 0) { + mCount += d; + } + return d; + } + @Override public String toString() { return String.format("FixedLengthInputStream(in=%s, length=%d)", mIn.toString(), mLength);