samtools/htsjdk — pull request #137 by mbreese (2014-12-02 00:43:56+00:00)
Title: Always flush outputStream, regardless of instanceof FileOutputStream

The outputStream should always be flushed. If you only flush FileOutputStreams, you'll get file truncation errors when the files are read in. I think this is probably related to wrapping the FileOutputStream in a BufferedOutputStream. Perhaps the default value changed at some point.

I was getting intermittent File truncation errors, but now I'm getting good files.