public static SAMFileHeader readSAMHeaderFrom ( final InputStream in , final Configuration conf ) { final ValidationStringency stringency = getValidationStringency ( conf ) ; SamReaderFactory readerFactory = SamReaderFactory . makeDefault ( ) . setOption ( SamReaderFactory . Option . EAGERLY_DECODE , false ) . setUseAsyncIo ( false ) ; if ( stringency != null ) { readerFactory . validationStringency ( stringency ) ; } final ReferenceSource refSource = getReferenceSource ( conf ) ; if ( null != refSource ) { readerFactory . referenceSource ( refSource ) ; } return readerFactory . open ( SamInputResource . of ( in ) ) . getFileHeader ( ) ; }
Does not close the stream .