biogo / hts

biogo high throughput sequencing repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bgzf/index: chunk reader may over-run chunk by one buffer length when end block offset is 0

kortschak opened this issue · comments

See logged cases in #14 tests. It is not possible for the chunk reader to know that a read will result in a step to another BGZF block, so there is no way other than reading to progress the last chunk interval beyond the desired chunk end and trigger termination.

The two options for additional API are a method to return whether the next read will move to another block or to return the remaining number of bytes in the current block. The latter seems more sensible.