Optimised skip() method for LZ4BlockInputStream
If I only want to decompress some part of the file, let's say a section at the begining and some other bits at the end, I can use skip(). But it looks to me like skiping through the file would currently still mean calling refill() on every block in between. Am I right? Is it possible to only read the headers in between and and then only the block to be ready for the next call to read()? People might scan the file using an index for example.
Interesting idea. As I want to release the next version as soon as possible, let me think about it after the next release. Thanks!
@odaira one way to do this is to set content (uncompressed) size as well as block size according to frame format (https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md). The content size is optional. In this way we can only decode each block's header to get all the info we need for skip()