[ 
https://issues.apache.org/jira/browse/IMAGING-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14036334#comment-14036334
 ] 

Gary Gregory commented on IMAGING-128:
--------------------------------------

This patch is not a must since it is the responsibility of the called to deal 
with its output stream. If you do not {{close()}} the stream, then all bets are 
off WRT what ends up in the file (or whatever the stream points). If we take 
this the next step, I do not think it is reasonable to say that all APIs that 
take an OuputStream MUST flush it before returning control to the call site.

> TIFF Image Writer is not flushing output
> ----------------------------------------
>
>                 Key: IMAGING-128
>                 URL: https://issues.apache.org/jira/browse/IMAGING-128
>             Project: Commons Imaging
>          Issue Type: Bug
>            Reporter: Gary Lucas
>            Priority: Minor
>         Attachments: Imaging_128_Patch_1.patch
>
>
> The writeImage() method in the TiffImageWriterBase class takes an 
> java.io.OutputStream argument as the destination for its output.  It does not 
> explicitly call flush() on the output stream when it is finished writing 
> data.  If the calling application allows the output stream to go out of 
> scope, rather than explicitly calling close(), any pending output will be 
> lost and the output image file will be left in a broken state.  Although, 
> ideally, applications SHOULD explicitly call close() on an i/o file, we 
> should probably add a call to flush to the writeImage method to provide some 
> robustness.
> This behavior was observed in Java 7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to