cache_write
if (cache_write(outfile, buf, ret) == BAM_ERROR) {
if (cache_write(outupdt, buf, ret) == BAM_ERROR)