Author: bodewig
Date: Tue Feb 10 14:20:05 2009
New Revision: 742977
URL: http://svn.apache.org/viewvc?rev=742977&view=rev
Log:
fix whitespace
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
Tue Feb 10 14:20:05 2009
@@ -23,11 +23,11 @@
public abstract class ArchiveInputStream extends InputStream {
- /**
+ /**
* Returns the next Archive Entry in this Stream.
* @return the next entry
* @throws IOException if the next entry could not be read
*/
public abstract ArchiveEntry getNextEntry() throws IOException;
-
+
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -29,6 +29,6 @@
}
public abstract void putArchiveEntry(ArchiveEntry entry) throws
IOException;
-
+
public abstract void closeArchiveEntry() throws IOException;
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
Tue Feb 10 14:20:05 2009
@@ -28,15 +28,15 @@
private final InputStream input;
private long offset = 0;
-
+
public ArArchiveInputStream( final InputStream pInput ) {
input = pInput;
}
-
+
public ArchiveEntry getNextEntry() throws IOException {
-
+
if (offset == 0) {
- final byte[] expected = "!<arch>\n".getBytes();
+ final byte[] expected = "!<arch>\n".getBytes();
final byte[] realized = new byte[expected.length];
final int read = read(realized);
if (read != expected.length) {
@@ -52,7 +52,7 @@
if (input.available() == 0) {
return null;
}
-
+
if (offset % 2 != 0) {
read();
}
@@ -63,7 +63,7 @@
final byte[] groupid = new byte[6];
final byte[] filemode = new byte[8];
final byte[] length = new byte[10];
-
+
read(name);
read(lastmodified);
read(userid);
@@ -72,7 +72,7 @@
read(length);
{
- final byte[] expected = "`\012".getBytes();
+ final byte[] expected = "`\012".getBytes();
final byte[] realized = new byte[expected.length];
final int read = read(realized);
if (read != expected.length) {
@@ -84,18 +84,18 @@
}
}
}
-
+
return new ArArchiveEntry(new String(name).trim(), Long.parseLong(new
String(length).trim()));
-
+
}
-
-
+
+
public int read() throws IOException {
final int ret = input.read();
offset++;
return ret;
}
-
+
public int read(byte b[]) throws IOException {
final int ret = read(b, 0, b.length);
offset = offset + b.length;
@@ -107,10 +107,10 @@
offset = offset + off;
return ret;
}
-
+
public static boolean matches(byte[] signature, int length) {
// 3c21 7261 6863 0a3e
-
+
if (length < 8) {
return false;
}
@@ -138,7 +138,7 @@
if (signature[7] != 0x0a) {
return false;
}
-
+
return true;
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -26,135 +26,135 @@
public class ArArchiveOutputStream extends ArchiveOutputStream {
- private long archiveOffset = 0;
- private long entryOffset = 0;
- private ArArchiveEntry prevEntry;
-
- public ArArchiveOutputStream( final OutputStream pOut ) {
- super(pOut);
- }
-
- private long writeArchiveHeader() throws IOException {
- final String header = "!<arch>\n";
- out.write(header.getBytes());
- return header.length();
- }
-
- public void closeArchiveEntry() throws IOException {
- if ((entryOffset % 2) != 0) {
- out.write('\n');
- archiveOffset++;
- }
- }
-
- public void putArchiveEntry( final ArchiveEntry pEntry ) throws
IOException {
- ArArchiveEntry pArEntry = (ArArchiveEntry)pEntry;
- if (prevEntry == null) {
- archiveOffset += writeArchiveHeader();
- } else {
- if (prevEntry.getLength() != entryOffset) {
- throw new IOException("length does not match
entry (" + prevEntry.getLength() + " != " + entryOffset);
- }
-
- closeArchiveEntry();
- }
-
- prevEntry = pArEntry;
-
- archiveOffset += writeEntryHeader(pArEntry);
-
- entryOffset = 0;
- }
-
- private long fill( final long pOffset, final long pNewOffset, final
char pFill ) throws IOException {
- final long diff = pNewOffset - pOffset;
-
- if (diff > 0) {
- for (int i = 0; i < diff; i++) {
- write(pFill);
- }
- }
-
- return pNewOffset;
- }
-
- private long write( final String data ) throws IOException {
- final byte[] bytes = data.getBytes("ascii");
- write(bytes);
- return bytes.length;
- }
-
- private long writeEntryHeader( final ArArchiveEntry pEntry ) throws
IOException {
-
- long offset = 0;
-
- final String n = pEntry.getName();
- if (n.length() > 16) {
- throw new IOException("filename too long");
- }
- offset += write(n);
-
- offset = fill(offset, 16, ' ');
- final String m = "" + (pEntry.getLastModified() / 1000);
- if (m.length() > 12) {
- throw new IOException("modified too long");
- }
- offset += write(m);
-
- offset = fill(offset, 28, ' ');
- final String u = "" + pEntry.getUserId();
- if (u.length() > 6) {
- throw new IOException("userid too long");
- }
- offset += write(u);
-
- offset = fill(offset, 34, ' ');
- final String g = "" + pEntry.getGroupId();
- if (g.length() > 6) {
- throw new IOException("groupid too long");
- }
- offset += write(g);
-
- offset = fill(offset, 40, ' ');
- final String fm = "" + Integer.toString(pEntry.getMode(), 8);
- if (fm.length() > 8) {
- throw new IOException("filemode too long");
- }
- offset += write(fm);
-
- offset = fill(offset, 48, ' ');
- final String s = "" + pEntry.getLength();
- if (s.length() > 10) {
- throw new IOException("size too long");
- }
- offset += write(s);
-
- offset = fill(offset, 58, ' ');
-
- offset += write("`\012");
-
- return offset;
- }
-
- public void write(int b) throws IOException {
- out.write(b);
- entryOffset++;
- }
-
- public void write(byte[] b, int off, int len) throws IOException {
- out.write(b, off, len);
- entryOffset += len;
- }
-
- public void write(byte[] b) throws IOException {
- out.write(b);
- entryOffset += b.length;
- }
-
- public void close() throws IOException {
- closeArchiveEntry();
- out.close();
- prevEntry = null;
- }
+ private long archiveOffset = 0;
+ private long entryOffset = 0;
+ private ArArchiveEntry prevEntry;
+
+ public ArArchiveOutputStream( final OutputStream pOut ) {
+ super(pOut);
+ }
+
+ private long writeArchiveHeader() throws IOException {
+ final String header = "!<arch>\n";
+ out.write(header.getBytes());
+ return header.length();
+ }
+
+ public void closeArchiveEntry() throws IOException {
+ if ((entryOffset % 2) != 0) {
+ out.write('\n');
+ archiveOffset++;
+ }
+ }
+
+ public void putArchiveEntry( final ArchiveEntry pEntry ) throws
IOException {
+ ArArchiveEntry pArEntry = (ArArchiveEntry)pEntry;
+ if (prevEntry == null) {
+ archiveOffset += writeArchiveHeader();
+ } else {
+ if (prevEntry.getLength() != entryOffset) {
+ throw new IOException("length does not match entry (" +
prevEntry.getLength() + " != " + entryOffset);
+ }
+
+ closeArchiveEntry();
+ }
+
+ prevEntry = pArEntry;
+
+ archiveOffset += writeEntryHeader(pArEntry);
+
+ entryOffset = 0;
+ }
+
+ private long fill( final long pOffset, final long pNewOffset, final char
pFill ) throws IOException {
+ final long diff = pNewOffset - pOffset;
+
+ if (diff > 0) {
+ for (int i = 0; i < diff; i++) {
+ write(pFill);
+ }
+ }
+
+ return pNewOffset;
+ }
+
+ private long write( final String data ) throws IOException {
+ final byte[] bytes = data.getBytes("ascii");
+ write(bytes);
+ return bytes.length;
+ }
+
+ private long writeEntryHeader( final ArArchiveEntry pEntry ) throws
IOException {
+
+ long offset = 0;
+
+ final String n = pEntry.getName();
+ if (n.length() > 16) {
+ throw new IOException("filename too long");
+ }
+ offset += write(n);
+
+ offset = fill(offset, 16, ' ');
+ final String m = "" + (pEntry.getLastModified() / 1000);
+ if (m.length() > 12) {
+ throw new IOException("modified too long");
+ }
+ offset += write(m);
+
+ offset = fill(offset, 28, ' ');
+ final String u = "" + pEntry.getUserId();
+ if (u.length() > 6) {
+ throw new IOException("userid too long");
+ }
+ offset += write(u);
+
+ offset = fill(offset, 34, ' ');
+ final String g = "" + pEntry.getGroupId();
+ if (g.length() > 6) {
+ throw new IOException("groupid too long");
+ }
+ offset += write(g);
+
+ offset = fill(offset, 40, ' ');
+ final String fm = "" + Integer.toString(pEntry.getMode(), 8);
+ if (fm.length() > 8) {
+ throw new IOException("filemode too long");
+ }
+ offset += write(fm);
+
+ offset = fill(offset, 48, ' ');
+ final String s = "" + pEntry.getLength();
+ if (s.length() > 10) {
+ throw new IOException("size too long");
+ }
+ offset += write(s);
+
+ offset = fill(offset, 58, ' ');
+
+ offset += write("`\012");
+
+ return offset;
+ }
+
+ public void write(int b) throws IOException {
+ out.write(b);
+ entryOffset++;
+ }
+
+ public void write(byte[] b, int off, int len) throws IOException {
+ out.write(b, off, len);
+ entryOffset += len;
+ }
+
+ public void write(byte[] b) throws IOException {
+ out.write(b);
+ entryOffset += b.length;
+ }
+
+ public void close() throws IOException {
+ closeArchiveEntry();
+ out.close();
+ prevEntry = null;
+ }
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java
Tue Feb 10 14:20:05 2009
@@ -58,7 +58,7 @@
*/
public class CpioArchiveInputStream extends ArchiveInputStream implements
CpioConstants {
-
+
private boolean closed = false;
private CpioArchiveEntry entry;
@@ -72,7 +72,7 @@
private byte tmpbuf[] = new byte[4096];
private long crc = 0;
-
+
private InputStream in = null;
/**
@@ -441,10 +441,10 @@
}
return (ArchiveEntry)entry;
}
-
+
public static boolean matches(byte[] signature, int length) {
// 3037 3037 30
-
+
if (length < 5) {
return false;
}
@@ -463,7 +463,7 @@
if (signature[4] != 0x30) {
return false;
}
-
+
return true;
}
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -55,7 +55,7 @@
* based on code from the jRPM project (jrpm.sourceforge.net)
*/
public class CpioArchiveOutputStream extends ArchiveOutputStream implements
CpioConstants {
-
+
private CpioArchiveEntry cpioEntry;
private boolean closed = false;
@@ -69,7 +69,7 @@
private long crc = 0;
private long written;
-
+
/**
* Check to make sure that this stream has not been closed
*
@@ -110,13 +110,13 @@
*/
public void setFormat(final short format) {
switch (format) {
- case FORMAT_NEW:
- case FORMAT_NEW_CRC:
- case FORMAT_OLD_ASCII:
- case FORMAT_OLD_BINARY:
- break;
- default:
- throw new IllegalArgumentException("Unknown header type");
+ case FORMAT_NEW:
+ case FORMAT_NEW_CRC:
+ case FORMAT_OLD_ASCII:
+ case FORMAT_OLD_BINARY:
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown header type");
}
synchronized (this) {
@@ -158,23 +158,23 @@
private void writeHeader(final CpioArchiveEntry e) throws IOException {
switch (e.getFormat()) {
- case FORMAT_NEW:
- out.write(MAGIC_NEW.getBytes());
- writeNewEntry(e);
- break;
- case FORMAT_NEW_CRC:
- out.write(MAGIC_NEW_CRC.getBytes());
- writeNewEntry(e);
- break;
- case FORMAT_OLD_ASCII:
- out.write(MAGIC_OLD_ASCII.getBytes());
- writeOldAsciiEntry(e);
- break;
- case FORMAT_OLD_BINARY:
- boolean swapHalfWord = true;
- writeBinaryLong(MAGIC_OLD_BINARY, 2, swapHalfWord);
- writeOldBinaryEntry(e, swapHalfWord);
- break;
+ case FORMAT_NEW:
+ out.write(MAGIC_NEW.getBytes());
+ writeNewEntry(e);
+ break;
+ case FORMAT_NEW_CRC:
+ out.write(MAGIC_NEW_CRC.getBytes());
+ writeNewEntry(e);
+ break;
+ case FORMAT_OLD_ASCII:
+ out.write(MAGIC_OLD_ASCII.getBytes());
+ writeOldAsciiEntry(e);
+ break;
+ case FORMAT_OLD_BINARY:
+ boolean swapHalfWord = true;
+ writeBinaryLong(MAGIC_OLD_BINARY, 2, swapHalfWord);
+ writeOldBinaryEntry(e, swapHalfWord);
+ break;
}
}
@@ -238,8 +238,8 @@
if (this.cpioEntry.getSize() != this.written) {
throw new IOException("invalid entry size (expected "
- + this.cpioEntry.getSize() + " but got " + this.written
- + " bytes)");
+ + this.cpioEntry.getSize() + " but got " +
this.written
+ + " bytes)");
}
if ((this.cpioEntry.getFormat() | FORMAT_NEW_MASK) == FORMAT_NEW_MASK)
{
pad(this.cpioEntry.getSize(), 4);
@@ -267,7 +267,7 @@
* occurred
*/
public synchronized void write(final byte[] b, final int off, final int
len)
- throws IOException {
+ throws IOException {
ensureOpen();
if (off < 0 || len < 0 || off > b.length - len) {
throw new IndexOutOfBoundsException();
@@ -367,8 +367,8 @@
}
private void writeCString(final String str) throws IOException {
- out.write(str.getBytes());
- out.write('\0');
+ out.write(str.getBytes());
+ out.write('\0');
}
/**
@@ -408,24 +408,24 @@
return ret;
}
- /* (non-Javadoc)
- * @see
org.apache.commons.compress.archivers.ArchiveOutputStream#closeArchiveEntry()
- */
- public void closeArchiveEntry() throws IOException {
- this.closeEntry();
- }
-
- /* (non-Javadoc)
- * @see
org.apache.commons.compress.archivers.ArchiveOutputStream#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)
- */
- public void putArchiveEntry(ArchiveEntry entry) throws IOException {
- this.putNextEntry((CpioArchiveEntry)entry);
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#write(int)
- */
- public void write(int b) throws IOException {
- out.write(b);
- }
+ /* (non-Javadoc)
+ * @see
org.apache.commons.compress.archivers.ArchiveOutputStream#closeArchiveEntry()
+ */
+ public void closeArchiveEntry() throws IOException {
+ this.closeEntry();
+ }
+
+ /* (non-Javadoc)
+ * @see
org.apache.commons.compress.archivers.ArchiveOutputStream#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)
+ */
+ public void putArchiveEntry(ArchiveEntry entry) throws IOException {
+ this.putNextEntry((CpioArchiveEntry)entry);
+ }
+
+ /* (non-Javadoc)
+ * @see java.io.OutputStream#write(int)
+ */
+ public void write(int b) throws IOException {
+ out.write(b);
+ }
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
Tue Feb 10 14:20:05 2009
@@ -30,7 +30,7 @@
public JarArchiveInputStream( final InputStream inputStream ) {
super(inputStream);
}
-
+
public ArchiveEntry getNextEntry() throws IOException {
ZipArchiveEntry entry = (ZipArchiveEntry)super.getNextEntry();
if(entry == null) {
@@ -39,7 +39,7 @@
return (ArchiveEntry)new JarArchiveEntry(entry);
}
}
-
+
public static boolean matches(byte[] signature, int length ) {
// 4b50 0403 0014 0008
@@ -71,7 +71,7 @@
if (signature[7] != 0x00) {
return false;
}
-
+
return true;
}
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -27,13 +27,13 @@
public class JarArchiveOutputStream extends ZipArchiveOutputStream {
- public JarArchiveOutputStream( final OutputStream out ) {
- super(out);
- setEncoding("UTF8");
- }
+ public JarArchiveOutputStream( final OutputStream out ) {
+ super(out);
+ setEncoding("UTF8");
+ }
- public void putArchiveEntry(ArchiveEntry entry) throws IOException {
- // TODO special jar stuff
- super.putArchiveEntry((ZipArchiveEntry) entry);
- }
+ public void putArchiveEntry(ArchiveEntry entry) throws IOException {
+ // TODO special jar stuff
+ super.putArchiveEntry((ZipArchiveEntry) entry);
+ }
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java
Tue Feb 10 14:20:05 2009
@@ -212,10 +212,10 @@
if (debug) {
System.err.println("TarInputStream: SKIP currENTRY '"
- + currEntry.getName() + "' SZ "
- + entrySize + " OFF "
- + entryOffset + " skipping "
- + numToSkip + " bytes");
+ + currEntry.getName() + "' SZ "
+ + entrySize + " OFF "
+ + entryOffset + " skipping "
+ + numToSkip + " bytes");
}
while (numToSkip > 0) {
@@ -251,9 +251,9 @@
if (debug) {
System.err.println("TarInputStream: SET CURRENTRY '"
- + currEntry.getName()
- + "' size = "
- + currEntry.getSize());
+ + currEntry.getName()
+ + "' size = "
+ + currEntry.getSize());
}
entryOffset = 0;
@@ -325,7 +325,7 @@
if (readBuf != null) {
int sz = (numToRead > readBuf.length) ? readBuf.length
- : numToRead;
+ : numToRead;
System.arraycopy(readBuf, 0, buf, offset, sz);
@@ -351,7 +351,7 @@
if (rec == null) {
// Unexpected EOF!
throw new IOException("unexpected EOF with " + numToRead
- + " bytes unread");
+ + " bytes unread");
}
int sz = numToRead;
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -172,7 +172,7 @@
// create a TarEntry for the LongLink, the contents
// of which are the entry's name
TarArchiveEntry longLinkEntry = new
TarArchiveEntry(TarConstants.GNU_LONGLINK,
-
TarConstants.LF_GNUTYPE_LONGNAME);
+
TarConstants.LF_GNUTYPE_LONGNAME);
longLinkEntry.setSize(entry.getName().length() + 1);
putNextEntry(longLinkEntry);
@@ -181,8 +181,8 @@
closeEntry();
} else if (longFileMode != LONGFILE_TRUNCATE) {
throw new RuntimeException("file name '" + entry.getName()
- + "' is too long ( > "
- + TarConstants.NAMELEN + "
bytes)");
+ + "' is too long ( > "
+ + TarConstants.NAMELEN + " bytes)");
}
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Tue Feb 10 14:20:05 2009
@@ -44,12 +44,12 @@
public int read(byte[] b, int off, int len) throws IOException {
return input.read(b, off, len);
}
-
+
public int read() throws IOException {
return input.read();
}
-
+
public static boolean matches( byte[] signature, int length ) {
// 4b50 0403 0014 0000
@@ -81,7 +81,7 @@
if (signature[7] != 0x00) {
return false;
}
-
+
return true;
}
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -467,7 +467,7 @@
if (level < Deflater.DEFAULT_COMPRESSION
|| level > Deflater.BEST_COMPRESSION) {
throw new IllegalArgumentException(
- "Invalid compression level: " + level);
+ "Invalid compression level: " +
level);
}
hasCompressionLevelChanged = (this.level != level);
this.level = level;
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorInputStream.java
Tue Feb 10 14:20:05 2009
@@ -21,5 +21,5 @@
import java.io.InputStream;
public abstract class CompressorInputStream extends InputStream {
- // TODO
+ // TODO
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -21,5 +21,5 @@
import java.io.OutputStream;
public abstract class CompressorOutputStream extends OutputStream {
- // TODO
+ // TODO
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -161,7 +161,7 @@
weight[nNodes] = ((weight[n1] & 0xffffff00)
+ (weight[n2] & 0xffffff00))
| (1 + (((weight[n1] & 0x000000ff)
- > (weight[n2] & 0x000000ff))
+ > (weight[n2] & 0x000000ff))
? (weight[n1] & 0x000000ff)
: (weight[n2] & 0x000000ff)));
@@ -378,9 +378,9 @@
finish();
super.close();
bsStream.close();
- closed = true;
+ closed = true;
}
-
+
protected void finish() throws IOException {
if (closed) {
return;
@@ -438,9 +438,9 @@
// If the stream was empty we must skip the rest of this method.
// See bug#32200.
if (last == -1) {
- return;
+ return;
}
-
+
/* sort the block and establish posn of original string */
doReversibleTransformation();
@@ -1211,7 +1211,7 @@
j = i;
while ((ftab[((runningOrder[j - h]) + 1) << 8]
- ftab[(runningOrder[j - h]) << 8])
- > (ftab[((vv) + 1) << 8] - ftab[(vv) << 8])) {
+ > (ftab[((vv) + 1) << 8] - ftab[(vv) << 8])) {
runningOrder[j] = runningOrder[j - h];
j = j - h;
if (j <= (h - 1)) {
@@ -1505,8 +1505,8 @@
usually small, typically <= 20.
*/
private int[] incs = {1, 4, 13, 40, 121, 364, 1093, 3280,
- 9841, 29524, 88573, 265720,
- 797161, 2391484};
+ 9841, 29524, 88573, 265720,
+ 797161, 2391484};
private void allocateCompressStructures () {
int n = baseBlockSize * blockSize100k;
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
Tue Feb 10 14:20:05 2009
@@ -26,14 +26,14 @@
public class GzipCompressorInputStream extends CompressorInputStream {
- private final GZIPInputStream in;
-
- public GzipCompressorInputStream(InputStream inputStream) throws
IOException {
- in = new GZIPInputStream(inputStream);
- }
+ private final GZIPInputStream in;
- public int read() throws IOException {
- return in.read();
- }
+ public GzipCompressorInputStream(InputStream inputStream) throws
IOException {
+ in = new GZIPInputStream(inputStream);
+ }
+
+ public int read() throws IOException {
+ return in.read();
+ }
}
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java?rev=742977&r1=742976&r2=742977&view=diff
==============================================================================
---
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
(original)
+++
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
Tue Feb 10 14:20:05 2009
@@ -25,19 +25,19 @@
import org.apache.commons.compress.compressors.CompressorOutputStream;
public class GzipCompressorOutputStream extends CompressorOutputStream {
-
- private final GZIPOutputStream out;
-
- public GzipCompressorOutputStream( final OutputStream outputStream )
throws IOException {
- out = new GZIPOutputStream(outputStream);
- }
-
- public void write(int b) throws IOException {
- out.write(b);
- }
-
- public void close() throws IOException {
- out.close();
- }
+
+ private final GZIPOutputStream out;
+
+ public GzipCompressorOutputStream( final OutputStream outputStream )
throws IOException {
+ out = new GZIPOutputStream(outputStream);
+ }
+
+ public void write(int b) throws IOException {
+ out.write(b);
+ }
+
+ public void close() throws IOException {
+ out.close();
+ }
}