You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to enhance the GzDecoder with the std::io::Seek trait and std::io::rewind() capacities, to rewind the file although we might already have uncompressed some data. Is that even doable ?
My first basic attempt here, I implement the Seek trait. Let's say I uncompressed a first line, then call Seek(pos=0) to rewind, the first line is forever lost and cannot be uncompressed a second time.
My second attempt here
I try to implement something that would rewind right after the .gz header (that we would never read again) and try to reset the FSM at the beginning of the file Body. Same results, it's like none of the things I do have an impact. I guess I'm missing some important attributes to reset, but I'm having a hard time understanding the code.
Any advice ?
The text was updated successfully, but these errors were encountered:
To anyone looking for a solution: in case you really need Seek and you dont mind RAM overhead -- you can use SeekableReader. It is Read + Seek wrapper around Read that caches read data within internal buffer.
Hello,
I would like to enhance the
GzDecoder
with thestd::io::Seek
trait andstd::io::rewind()
capacities, to rewind the file although we might already have uncompressed some data. Is that even doable ?My first basic attempt here, I implement the
Seek
trait. Let's say I uncompressed a first line, then call Seek(pos=0) to rewind, the first line is forever lost and cannot be uncompressed a second time.My second attempt here
I try to implement something that would rewind right after the .gz header (that we would never read again) and try to reset the FSM at the beginning of the file Body. Same results, it's like none of the things I do have an impact. I guess I'm missing some important attributes to reset, but I'm having a hard time understanding the code.
Any advice ?
The text was updated successfully, but these errors were encountered: