Author: sebb
Date: Sun Mar 29 14:49:54 2009
New Revision: 759702

URL: http://svn.apache.org/viewvc?rev=759702&view=rev
Log:
Detect when target buffer has been closed

Modified:
    
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java

Modified: 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java
URL: 
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java?rev=759702&r1=759701&r2=759702&view=diff
==============================================================================
--- 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java
 (original)
+++ 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java
 Sun Mar 29 14:49:54 2009
@@ -211,6 +211,9 @@
         }
 
         if (inStream == null) {
+            if (outStream == null) {
+                throw new IOException("input buffer is closed");
+            }
             throw new IOException("reading from an output buffer");
         }
 
@@ -332,6 +335,9 @@
         }
 
         if (outStream == null) {
+            if (inStream == null){
+                throw new IOException("Output buffer is closed");
+            }
             throw new IOException("writing to an input buffer");
         }
 
@@ -369,6 +375,9 @@
         }
 
         if (outStream == null) {
+            if (inStream == null){
+                throw new IOException("Output buffer is closed");
+            }
             throw new IOException("writing to an input buffer");
         }
 


Reply via email to