Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kortschak opened this issue Sep 17, 2015 · 0 comments

Comments

@kortschak
Copy link
Member

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.

kortschak added a commit that referenced this issue Sep 18, 2015
…ock offset 0

Also fix LastChunk in bgzf.Reader where a zero-length read leave the
chunk with an end offset that is before the begin offset.

Fixes #17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant