-
Notifications
You must be signed in to change notification settings - Fork 78
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
Report the offset at which "Unexpected EOF" error occured #221
Comments
The last time I tried something like this Regardless, you are right that there isn't a way to figure out how many compressed bytes have been read after decompression completes. This should be addressable in the streaming API without much difficulty, but it will not be added to the standard buffer-based API (to keep that API simple and bloat-free). Will look into it for the next release. |
What can't you do right now?
I'm trying to process a buffer with sections that are compressed with deflate. I know where these sections start, but have no idea how long they are. I need to skip past these sections so I can continue processing the buffer.
If there were a way to know at which offset EOF happened I would be able to skip past these sections.
Example Buffer:
An optimal solution
Two possibilities:
inflate
command succeeds with the decompressed data and tells you how many bytes remained unprocessed in the input.How is this done by other libraries?
pako
(which I'm currently using) doesn't fail when hitting the EOF. Instead it emits the decompressed data & has a value you can read the tells you how many bytes have remained unprocessed.Eg. If you have a 150byte buffer and the first 100 are deflated-data, it will emit the decompressed data & tell you there are 50 bytes remaining.
The text was updated successfully, but these errors were encountered: