Skip to content

Commit 022d817

Browse files
committed
Bugzilla #34142: use writeTo() instead of toByteArray in DeferredFileOutputStream.thresholdReached().
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@158731 13f79535-47bb-0310-9956-ffa450edef68
1 parent 05abaab commit 022d817

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ protected OutputStream getStream() throws IOException
119119
*/
120120
protected void thresholdReached() throws IOException
121121
{
122-
byte[] data = memoryOutputStream.toByteArray();
123122
FileOutputStream fos = new FileOutputStream(outputFile);
124-
fos.write(data);
123+
memoryOutputStream.writeTo(fos);
125124
diskOutputStream = fos;
126125
currentOutputStream = fos;
127126
memoryOutputStream = null;

0 commit comments

Comments
 (0)