You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/03/28 04:18:44 UTC
svn commit: r759425 - in
/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers:
cpio/CpioArchiveInputStream.java zip/ZipLong.java
Author: sebb
Date: Sat Mar 28 03:18:42 2009
New Revision: 759425
URL: http://svn.apache.org/viewvc?rev=759425&view=rev
Log:
DOcument and simplify
Modified:
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java?rev=759425&r1=759424&r2=759425&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java Sat Mar 28 03:18:42 2009
@@ -257,7 +257,7 @@
throw new IOException("CRC Error");
}
}
- return -1;
+ return -1; // EOF for this entry
}
int tmplength = (int) Math.min(len, this.entry.getSize()
- this.entryBytesRead);
@@ -267,7 +267,7 @@
int tmpread = this.in.read(b, off, tmplength);
// TODO - what about EOF or short reads?
- if ((this.entry.getFormat() | FORMAT_NEW_CRC) == FORMAT_NEW_CRC) {
+ if (this.entry.getFormat() == FORMAT_NEW_CRC) {
for (int pos = 0; pos < tmpread; pos++) {
this.crc += b[pos] & 0xFF;
}
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java?rev=759425&r1=759424&r2=759425&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java Sat Mar 28 03:18:42 2009
@@ -42,7 +42,10 @@
private final long value;
+ /** Central File Header Signature */
public static final ZipLong CFH_SIG = new ZipLong(0X02014B50L);
+
+ /** Local File Header Signature */
public static final ZipLong LFH_SIG = new ZipLong(0X04034B50L);
/**