commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r911467 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Date Thu, 18 Feb 2010 16:11:13 GMT
Author: bodewig
Date: Thu Feb 18 16:11:13 2010
New Revision: 911467

URL: http://svn.apache.org/viewvc?rev=911467&view=rev
Log:
properly count bytes read.  COMPRESS-74

Modified:
    commons/proper/compress/trunk/src/changes/changes.xml
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java

Modified: commons/proper/compress/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=911467&r1=911466&r2=911467&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/changes/changes.xml (original)
+++ commons/proper/compress/trunk/src/changes/changes.xml Thu Feb 18 16:11:13 2010
@@ -23,6 +23,15 @@
   </properties>
   <body>
     <release version="1.1" date="as in SVN" description="Release 1.1">
+      <action type="fix" date="2010-02-18" issue="COMPRESS-74">
+        ZipArchiveInputStream failed to update the number of bytes
+        read properly.
+      </action>
+      <action type="fix" date="2010-02-18">
+        ArchiveInputStream has a new method getBytesRead that should
+        be preferred over getCount since the later may truncate the
+        number of bytes read for big archives.
+      </action>
       <action type="fix" date="2010-02-18" issue="COMPRESS-85">
         The cpio archives created by CpioArchiveOutputStream couldn't
         be read by many existing native implementations because the

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java?rev=911467&r1=911466&r2=911467&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Thu Feb 18 16:11:13 2010
@@ -338,6 +338,7 @@
                     throw new EOFException(
                             "Truncated ZIP entry: " + current.getName());
                 } else {
+                    count(n);
                     remaining -= n;
                 }
             }
@@ -356,6 +357,7 @@
             if ((diff = bytesReadFromStream - inB) != 0) {
                 ((PushbackInputStream) in).unread(
                         buf,  lengthOfLastRead - diff, diff);
+                pushedBackBytes(diff);
             }
         }
 
@@ -375,6 +377,7 @@
             throw new IOException("The stream is closed");
         }
         if ((lengthOfLastRead = in.read(buf)) > 0) {
+            count(lengthOfLastRead);
             inf.setInput(buf, 0, lengthOfLastRead);
         }
     }
@@ -386,6 +389,7 @@
             if (x == -1) {
                 throw new EOFException();
             }
+            count(x);
         }
     }
 }



Mime
View raw message