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

ok, after reading this, I think INVALID_POS should be -1.

Check that beginPos is __uint32 as casted into down here.