All of the public methods in SamIndexes have names that indicate that they return BAI streams ("openIndexFileAsBaiOrNull...", etc), which they do by either opening a BAI file directly, or opening a CRAI and converting it to BAI. For some reason when we added CSI, these code paths were updated to detect and return CSI streams as raw CSI, with no conversion, but these are not BAI streams. We should make the name of the class, and the names and behaviors of the methods somehow all mutually consistent.
All of the public methods in SamIndexes have names that indicate that they return BAI streams ("openIndexFileAsBaiOrNull...", etc), which they do by either opening a BAI file directly, or opening a CRAI and converting it to BAI. For some reason when we added CSI, these code paths were updated to detect and return CSI streams as raw CSI, with no conversion, but these are not BAI streams. We should make the name of the class, and the names and behaviors of the methods somehow all mutually consistent.