diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-12-28 02:35:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-28 02:35:07 +0000 |
commit | 281998c825ad48d842bb653e2f462719fdb0c1d9 (patch) | |
tree | bc8bfcce809257b3ddbb423a9808082292b9f6a3 /java/com/android/voicemail/impl/mail/FixedLengthInputStream.java | |
parent | fc81a030a7b4f6d4a497f71aed593d398795e7da (diff) | |
parent | 183cb71663320f16149d83eeebaff7795a4b55f2 (diff) |
Merge "Remove field prefixes."
Diffstat (limited to 'java/com/android/voicemail/impl/mail/FixedLengthInputStream.java')
-rw-r--r-- | java/com/android/voicemail/impl/mail/FixedLengthInputStream.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/java/com/android/voicemail/impl/mail/FixedLengthInputStream.java b/java/com/android/voicemail/impl/mail/FixedLengthInputStream.java index bd3c16401..473281e09 100644 --- a/java/com/android/voicemail/impl/mail/FixedLengthInputStream.java +++ b/java/com/android/voicemail/impl/mail/FixedLengthInputStream.java @@ -24,25 +24,25 @@ import java.io.InputStream; * where the protocol handler intended the client to read. */ public class FixedLengthInputStream extends InputStream { - private final InputStream mIn; - private final int mLength; - private int mCount; + private final InputStream in; + private final int length; + private int count; public FixedLengthInputStream(InputStream in, int length) { - this.mIn = in; - this.mLength = length; + this.in = in; + this.length = length; } @Override public int available() throws IOException { - return mLength - mCount; + return length - count; } @Override public int read() throws IOException { - if (mCount < mLength) { - mCount++; - return mIn.read(); + if (count < length) { + count++; + return in.read(); } else { return -1; } @@ -50,12 +50,12 @@ public class FixedLengthInputStream extends InputStream { @Override public int read(byte[] b, int offset, int length) throws IOException { - if (mCount < mLength) { - int d = mIn.read(b, offset, Math.min(mLength - mCount, length)); + if (count < this.length) { + int d = in.read(b, offset, Math.min(this.length - count, length)); if (d == -1) { return -1; } else { - mCount += d; + count += d; return d; } } else { @@ -69,11 +69,11 @@ public class FixedLengthInputStream extends InputStream { } public int getLength() { - return mLength; + return length; } @Override public String toString() { - return String.format("FixedLengthInputStream(in=%s, length=%d)", mIn.toString(), mLength); + return String.format("FixedLengthInputStream(in=%s, length=%d)", in.toString(), length); } } |