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/30 20:11:46 UTC

svn commit: r760082 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers: ar/ArArchiveInputStream.java tar/TarArchiveInputStream.java zip/ZipArchiveInputStream.java

Author: sebb
Date: Mon Mar 30 18:11:46 2009
New Revision: 760082

URL: http://svn.apache.org/viewvc?rev=760082&view=rev
Log:
Remove unnecessary override methods

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java?rev=760082&r1=760081&r2=760082&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java Mon Mar 30 18:11:46 2009
@@ -145,16 +145,6 @@
         currentEntry = null;
     }
 
-    public int read() throws IOException {
-        byte[] single = new byte[1];
-        int num = read(single, 0, 1);
-        return num == -1 ? -1 : single[0] & 0xff;
-    }
-
-    public int read(byte[] b) throws IOException {
-        return read(b, 0, b.length);
-    }
-
     public int read(byte[] b, final int off, final int len) throws IOException {
         int toRead = len;
         if (currentEntry != null) {

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java?rev=760082&r1=760081&r2=760082&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java Mon Mar 30 18:11:46 2009
@@ -40,7 +40,6 @@
     private static final int SMALL_BUFFER_SIZE = 256;
     private static final int BUFFER_SIZE = 8 * 1024;
     private static final int LARGE_BUFFER_SIZE = 32 * 1024;
-    private static final int BYTE_MASK = 0xFF;
 
     private boolean debug;
     private boolean hasHitEOF;
@@ -51,13 +50,6 @@
     private TarArchiveEntry currEntry;
 
     /**
-     * This contents of this array is not used at all in this class,
-     * it is only here to avoid repeated object creation during calls
-     * to the no-arg read method.
-     */
-    private final byte[] oneBuf;
-
-    /**
      * Constructor for TarInputStream.
      * @param is the input stream to use
      */
@@ -83,7 +75,6 @@
     public TarArchiveInputStream(InputStream is, int blockSize, int recordSize) {
         this.buffer = new TarBuffer(is, blockSize, recordSize);
         this.readBuf = null;
-        this.oneBuf = new byte[1];
         this.debug = false;
         this.hasHitEOF = false;
     }
@@ -270,19 +261,6 @@
     }
 
     /**
-     * Reads a byte from the current tar archive entry.
-     *
-     * This method simply calls read( byte[], int, int ).
-     *
-     * @return The byte read, or -1 at EOF.
-     * @throws IOException on error
-     */
-    public int read() throws IOException {
-        int num = read(oneBuf, 0, 1);
-        return num == -1 ? -1 : oneBuf[0] & BYTE_MASK;
-    }
-
-    /**
      * Reads bytes from the current tar archive entry.
      *
      * This method is aware of the boundaries of the current

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=760082&r1=760081&r2=760082&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 Mon Mar 30 18:11:46 2009
@@ -54,7 +54,6 @@
     private final Inflater inf = new Inflater(true);
     private final CRC32 crc = new CRC32();
 
-    private final byte[] SINGLE = new byte[1];
     private final byte[] buf = new byte[ZipArchiveOutputStream.BUFFER_SIZE];
 
     private ZipArchiveEntry current = null;
@@ -244,11 +243,6 @@
         }
     }
 
-    public int read() throws IOException {
-        int num = read(SINGLE, 0, 1);
-        return num == -1 ? -1 : SINGLE[0] & ZipArchiveOutputStream.BYTE_MASK;
-    }
-
     public long skip(long value) throws IOException {
         if (value >= 0) {
             long skipped = 0;