Open ljani opened 9 years ago
If you open with RarArchive, can you not seek?
Or do you mean you want the Stream from RarArchive be seekable?
I mean that it would be nice if the Stream
from RarArchiveEntry.OpenEntryStream()
would be seekable. For non-compressed rars, that shouldn't be too hard since you can read the stream directly from the file.
I thought about writing a wrapper, but you had hid the implementation details in internal
classes, so I couldn't access the data in eg FileParts
;)
It should be easy enough to be an if statement here: https://github.com/adamhathcock/sharpcompress/blob/master/SharpCompress/Archive/Rar/RarArchiveEntry.cs#L74
I can't remember where the store flag is.
All the interesting information is hidden in FileHeader
(eg. PackingMethod
, CompressedSize
and DataStartPosition
) and is not accessible to outside. I could to reflection, but it gets a bit ugly, because everything is internal
. Thus I decided against creating my own dirty wrapper and decided to ask if someone had interest to implement this properly in the library itself.
It seems like you could :)
Just fork and adjust the code. It doesn't seem like it would be a big job.
It'd be nice if RARs with
0x30
(store
) packing method could be seeked. That should work since that doesn't require any unpacking and can be read directly from disk. Some book keeping is needed though.