As a general rule it is best if BioJava doesn't handle the flushing
and closing of OutputStreams. This is because you may want to keep
using the stream and control it's behaivour. An interesting example is
if you pass System.out to a method that closes the stream. Probably
not what you want.

Having said that maybe we should add a javadoc to say that
BufferedOutputStreams need to be flushed (and possibly closed).

- Mark

On Wed, Oct 1, 2008 at 9:36 PM, Richard Holland
<[EMAIL PROTECTED]> wrote:
> The IOTools interfaces accept OutputStream instances, not
> BufferedOutputStream instances. flush() is not a requirement on
> OutputStream and so BJX does not call it.
>
> cheers,
> Richard
>
> 2008/10/1 pprun <[EMAIL PROTECTED]>:
>> Hi,
>> I don't know this is a feature or a bug,
>> If a BufferedOutputStream was passed to method
>> RichSequence.IOTools.writeGenbank(OutputStream os, Sequence seq,
>> Namespace ns),
>> at the end, I need to manually flush it - BufferedOutputStream.flush()
>>
>> Otherwise, the output content will be truncated.
>>
>> Is this the expected behavior?
>>
>> Thanks,
>> - Pprun
>>
>>
>> _______________________________________________
>> Biojava-l mailing list  -  [email protected]
>> http://lists.open-bio.org/mailman/listinfo/biojava-l
>>
>>
>
>
>
> --
> Richard Holland, BSc MBCS
> Finance Director, Eagle Genomics Ltd
> M: +44 7500 438846 | E: [EMAIL PROTECTED]
> http://www.eaglegenomics.com/
> _______________________________________________
> Biojava-l mailing list  -  [email protected]
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>
_______________________________________________
Biojava-l mailing list  -  [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l

Reply via email to