You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/10/08 15:04:10 UTC
svn commit: r823159 -
/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
Author: tellison
Date: Thu Oct 8 13:04:09 2009
New Revision: 823159
URL: http://svn.apache.org/viewvc?rev=823159&view=rev
Log:
Revert changes from r823144.
Modified:
harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java?rev=823159&r1=823158&r2=823159&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java (original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java Thu Oct 8 13:04:09 2009
@@ -382,11 +382,11 @@
@Override
public int read() throws IOException {
- int count = read(singleByteBuf, 0, 1);
- if (count == 1) {
- return singleByteBuf[0] & 0xFF;
+ if (read(singleByteBuf, 0, 1) == 1) {
+ return singleByteBuf[0] & 0XFF;
+ } else {
+ return -1;
}
- return count;
}
@Override
@@ -399,14 +399,16 @@
int count = mSharedRaf.read(b, off, len);
if (count > 0) {
mOffset += count;
+ return count;
+ } else {
+ return -1;
}
- return count;
}
}
@Override
public long skip(long n) throws IOException {
- if (n > mLength - mOffset) {
+ if (mOffset + n > mLength) {
n = mLength - mOffset;
}
mOffset += n;