### Eclipse Workspace Patch 1.0 #P ant-trunk Index: org/apache/tools/ant/taskdefs/StreamPumper.java =================================================================== --- org/apache/tools/ant/taskdefs/StreamPumper.java (revision 1292497) +++ org/apache/tools/ant/taskdefs/StreamPumper.java (working copy) @@ -129,11 +129,14 @@ break; } - length = is.read(buf); - if (length <= 0 || finish || Thread.interrupted()) { + int availableBytes = is.available(); + byte[] buf = new byte[availableBytes]; + int actualBytesRead = is.read(buf, 0, availableBytes); + + if (actualBytesRead <= 0 || finish || Thread.interrupted()) { break; } - os.write(buf, 0, length); + os.write(buf, 0, actualBytesRead); if (autoflush) { os.flush(); }