Skip to content

Commit 4e5a0e1

Browse files
committed
IO-211: Pre- and post-processing support for proxied streams
Add null protection as pointed out in IO-242 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@934041 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3c034f8 commit 4e5a0e1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/java/org/apache/commons/io/input/ProxyInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public int read() throws IOException {
7474
@Override
7575
public int read(byte[] bts) throws IOException {
7676
try {
77-
beforeRead(bts.length);
77+
beforeRead(bts != null ? bts.length : 0);
7878
int n = in.read(bts);
7979
afterRead(n);
8080
return n;

src/java/org/apache/commons/io/output/ProxyOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void write(int idx) throws IOException {
6868
@Override
6969
public void write(byte[] bts) throws IOException {
7070
try {
71-
beforeWrite(bts.length);
71+
beforeWrite(bts != null ? bts.length : 0);
7272
out.write(bts);
7373
afterWrite(bts.length);
7474
} catch (IOException e) {

0 commit comments

Comments
 (0)