Skip to content

Commit 982946b

Browse files
committed
[CLOUDBEES-2018] improving the performance under a large side buffer.
This might be a bug of its own that the unclaimed side buffer gets that long, but java.io.ByteArrayOutputStream really sucks as its bytes grow, and this does no harm
1 parent 0ea5a28 commit 982946b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

maven-plugin/src/main/java/hudson/maven/SplittableBuildListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import hudson.model.Result;
3030
import hudson.model.StreamBuildListener;
3131
import hudson.util.AbstractTaskListener;
32+
import org.apache.commons.io.output.ByteArrayOutputStream;
3233

33-
import java.io.ByteArrayOutputStream;
3434
import java.io.IOException;
3535
import java.io.OutputStream;
3636
import java.io.PrintStream;
@@ -95,7 +95,7 @@ public void setSideOutputStream(OutputStream os) throws IOException {
9595
if(os==null) {
9696
os = unclaimed;
9797
} else {
98-
os.write(unclaimed.toByteArray());
98+
unclaimed.writeTo(os);
9999
unclaimed = new ByteArrayOutputStream();
100100
}
101101
this.side = os;

0 commit comments

Comments
 (0)