commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r733694 - /commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
Date Mon, 12 Jan 2009 11:31:07 GMT
Author: tcurdt
Date: Mon Jan 12 03:31:06 2009
New Revision: 733694

URL: http://svn.apache.org/viewvc?rev=733694&view=rev
Log:
separate close from finish

to fix https://issues.apache.org/jira/browse/SANDBOX-194


Modified:
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java

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=733694&r1=733693&r2=733694&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
Mon Jan 12 03:31:06 2009
@@ -375,6 +375,16 @@
         if (closed) {
             return;
         }
+        finish();
+        super.close();
+        bsStream.close();
+        closed = true;    	
+    }
+    
+    protected void finish() throws IOException {
+        if (closed) {
+            return;
+        }
 
         if (runLength > 0) {
             writeRun();
@@ -382,9 +392,6 @@
         currentChar = -1;
         endBlock();
         endCompression();
-        closed = true;
-        super.close();
-        bsStream.close();
     }
 
     public void flush() throws IOException {



Mime
View raw message