DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34142>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34142

           Summary: use writeTo() instead of toByteArray in
                    DeferredFileOutputStream.thresholdReached()
           Product: Commons
           Version: unspecified
          Platform: All
               URL: http://cvs.apache.org/viewcvs.cgi/jakarta-
                    commons/io/src/java/org/apache/commons/io/output/Deferre
                    dFileOutputStream.java?view=annotate
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: IO
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


It is better not to allocate a new buffer when writing the memory buffer to 
file.

recommend using writeTo() insteand of toByteArray()
at DeferredFileOutputStream.java:120
------------
protected void thresholdReached() throws IOException
{
    FileOutputStream fos = new FileOutputStream(outputFile);
    memoryOutputStream.writeTo(fos);
    diskOutputStream = fos;
    currentOutputStream = fos;
    memoryOutputStream = null;
}
----------------------

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to