Permalink
Browse files

Merge pull request #184 from dicej/zip-available

remove redundant decrement in ZipFile.getInputStream inner class
  • Loading branch information...
2 parents 2036eea + 094af1e commit e837502d43d9b739085985260636b3364de6d6af @joshuawarner32 joshuawarner32 committed Feb 26, 2014
Showing with 3 additions and 5 deletions.
  1. +3 −5 classpath/java/util/zip/ZipFile.java
@@ -103,11 +103,9 @@ public InputStream getInputStream(ZipEntry entry) throws IOException {
int remaining = uncompressedSize(window, pointer);
public int read() throws IOException {
- int c = super.read();
- if (c >= 0) {
- -- remaining;
- }
- return c;
+ byte[] buffer = new byte[1];
+ int c = read(buffer);
+ return (c < 0 ? c : (buffer[0] & 0xFF));
}
public int read(byte[] buffer) throws IOException {

0 comments on commit e837502

Please sign in to comment.