BamTools provides both a programmer's API and an end-user's toolkit for handling BAM files. WWW: https://github.com/pezmaster31/bamtools