[FIX] Adapted the sam/bam module to new stream modul.

the same here. Please check the other writes as well. `int` should be removed if it was used to signal an error