commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r742987 - in /commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors: CompressorInputStream.java bzip2/BZip2CompressorInputStream.java gzip/GzipCompressorInputStream.java
Date Tue, 10 Feb 2009 14:54:24 GMT
Author: bodewig
Date: Tue Feb 10 14:53:54 2009
New Revision: 742987

URL: http://svn.apache.org/viewvc?rev=742987&view=rev
Log:
Make CompressorInputStream extend FilterInputStream

Modified:
    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/bzip2/BZip2CompressorInputStream.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java

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=742987&r1=742986&r2=742987&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:53:54 2009
@@ -18,8 +18,12 @@
  */
 package org.apache.commons.compress.compressors;
 
+import java.io.FilterInputStream;
 import java.io.InputStream;
 
-public abstract class CompressorInputStream extends InputStream {
+public abstract class CompressorInputStream extends FilterInputStream {
     // TODO 
+    protected CompressorInputStream(final InputStream i) {
+        super(i);
+    }
 }

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java?rev=742987&r1=742986&r2=742987&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
Tue Feb 10 14:53:54 2009
@@ -80,8 +80,6 @@
 
     private int nInUse;
 
-    private InputStream in;
-
     private int currentChar = -1;
 
     private static final int EOF                  = 0;
@@ -132,9 +130,8 @@
      *  if <tt>in == null</tt>
      */
     public BZip2CompressorInputStream(final InputStream in) throws IOException {
-        super();
+        super(in);
 
-        this.in = in;
         init();
     }
 

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=742987&r1=742986&r2=742987&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:53:54 2009
@@ -26,14 +26,8 @@
 
 public class GzipCompressorInputStream extends CompressorInputStream {
 
-    private final GZIPInputStream in; 
-
     public GzipCompressorInputStream(InputStream inputStream) throws IOException {
-        in = new GZIPInputStream(inputStream);
-    }
-
-    public int read() throws IOException {
-        return in.read();
+        super(new GZIPInputStream(inputStream));
     }
 
 }



Mime
View raw message