Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow BYTE_ARRAY_STOP to work on non-zero STOP code with TOK3.
Our htscodec name tokeniser decoder always adds nul bytes between names. This happens to match the default STOP byte used in htslib's CRAM implementation, but there's nothing to say it has to be 0 and indeed Java uses 9 (tab). This is an oversight and ideally we'd change the name tokeniser decode function to take an additional parameter to specify the stop byte, but that's changing the API. Easiest is just to recognise this on-the-fly and correct the error by looking for a different stop byte. Also fixed cram_uncompress_block setting of b->orig_method. This was only correct when the original prototype definitions of RANS_PR0 were in use, and with the RANSPR official numbering the calculation caused RLE+O1 to be mislabelled as TOK3. This field isn't used in anything else anyway during decode (but has some diagnostic usage during encode). The official API is via cram_block_get_method and cram_expand_method.
- Loading branch information