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

InputStream#seek #569

Open
tylerhunt opened this issue Feb 17, 2024 · 1 comment
Open

InputStream#seek #569

tylerhunt opened this issue Feb 17, 2024 · 1 comment

Comments

@tylerhunt
Copy link

Is it feasible to implement #seek on InputStream? This would make it possible to use with PDF::Reader, which checks for a duck that quacks #read and #seek.

@hainesr
Copy link
Member

hainesr commented Feb 24, 2024

I don't want to categorically say it's not feasible, but it's definitely non-trivial.

Presumably you want to seek from the perspective of the uncompressed data? There's no #seek on the underlying compressed stream provided by zlib, you can only read from the start. I think we could do it with an internal buffer, but we'd need to be very careful with very large zip entries filling up available memory. And seeking backwards would mean starting over and reading forwards again...

I'll have a think about it - you've piqued my interest - but I can't promise anything on any timeline, sorry.

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

2 participants