poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <n...@torchbox.com>
Subject Re: POI's behavior on close:
Date Fri, 21 Sep 2007 12:10:35 GMT
On Thu, 20 Sep 2007, m34 wrote:
> Having already written out to a workbook instance, when you subsequently 
> close an instance of a FileOutputStream, is the POI library--or even 
> Java?--designed to handle such a directive by ensuring that the file is 
> closed, before proceeding to the next line of code?

After you call wb.write(out), POI will have sent all the workbook data to 
the output stream, so its part in it is done.

What happens next is up to the OutputStream you're using. Some will need 
you to call flush before close, but most don't. All that follow the spec 
will finish after the close call, but it's not impossible that some 

If you're justing using normal java outputstreams, read the docs on them 
to be sure. If you're using unusual ones, your best bet is to write a unit 


To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message