commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r934041 - in /commons/proper/io/trunk/src/java/org/apache/commons/io: input/ProxyInputStream.java output/ProxyOutputStream.java
Date Wed, 14 Apr 2010 17:37:24 GMT
Author: jukka
Date: Wed Apr 14 17:37:24 2010
New Revision: 934041

URL: http://svn.apache.org/viewvc?rev=934041&view=rev
Log:
IO-211: Pre- and post-processing support for proxied streams

Add null protection as pointed out in IO-242

Modified:
    commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyInputStream.java
    commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyOutputStream.java

Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyInputStream.java?rev=934041&r1=934040&r2=934041&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyInputStream.java (original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyInputStream.java Wed
Apr 14 17:37:24 2010
@@ -74,7 +74,7 @@ public abstract class ProxyInputStream e
     @Override
     public int read(byte[] bts) throws IOException {
         try {
-            beforeRead(bts.length);
+            beforeRead(bts != null ? bts.length : 0);
             int n = in.read(bts);
             afterRead(n);
             return n;

Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyOutputStream.java?rev=934041&r1=934040&r2=934041&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyOutputStream.java (original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyOutputStream.java Wed
Apr 14 17:37:24 2010
@@ -68,7 +68,7 @@ public class ProxyOutputStream extends F
     @Override
     public void write(byte[] bts) throws IOException {
         try {
-            beforeWrite(bts.length);
+            beforeWrite(bts != null ? bts.length : 0);
             out.write(bts);
             afterWrite(bts.length);
         } catch (IOException e) {



Mime
View raw message