[FIX] fixed pointer-based bam write