harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r823159 - /harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
Date Thu, 08 Oct 2009 13:04:10 GMT
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;



Mime
View raw message