Closed jmthibault79 closed 2 years ago
I doubt there is any reason for it - sounds like a bug. The contents of the 20 byte space reserved in the header is not defined by the spec, and is left up to the implementation. htsjdk uses the first 20 bytes of the file name (which has it's own problems). We should fix it.
@jmthibault79 Is this still an issue, or was this fixed in one of your PRs ?
Addressed in #1306 which needs review
Fixed in refactor branch.
Fixed in CramHeader in #1440.
Subject of the issue
CramHeader construction with ID (and
setId()
) do not simply set the ID value. Instead they copy up to 20 bytes of the desired value into a 20-byte buffer. As a result, extra bytes remain in the buffer. If there was a previous longer ID set, the stale bytes past the new limit remain. As a result,setID()
andgetId()
do not round-trip.Is there a reason for this behavior?