mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
Are there any examples on how to use LzmaStream to compress and decompress a stream? #331
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @natiki on GitHub (Nov 5, 2018).
Hi,
I am getting a "Not Implemented" exception when I attempt to instantiate a LzmaStream.
@hopperpl commented on GitHub (Aug 16, 2019):
LZMA2 is not supported. Use false for the 2nd parameter in the LzmaStream constructor.
new LzmaStream(new LzmaEncoderProperties(), false, result)Had the same problem a moment ago.
@adamhathcock commented on GitHub (Aug 16, 2019):
LZMA2 is supported - https://github.com/adamhathcock/sharpcompress/blob/master/FORMATS.md
The internals aren’t straight forward but looking at the tests can give you some help. I’m on vacation for a few weeks with only a phone so I can’t offer more at the moment
@natiki commented on GitHub (Aug 18, 2019):
@adamhathcock Had a look at the tests and still not having any luck. When you are back from vacation would appreciate it, if you could have a look.
@adamhathcock commented on GitHub (Aug 21, 2019):
Using LZMA or LZMA2 directly requires creating a byte array of properties. I recognize this isn't easy to use but I haven't put a pretty interface on LzmaStream directly as it's intended to be used with an archive format.
Please read the readme for recommendations and links and not just blindly use "LZMA2" because people say it's always better
https://github.com/adamhathcock/sharpcompress#recommended-formats
https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm#LZMA2_format
@natiki commented on GitHub (Aug 27, 2019):
Thanks.... Building up a suite here for internal use.
@BoringName15 commented on GitHub (Nov 23, 2024):
This might be a specific use case but I was having issues with LzmaStream not including the 13 byte header information in the stream so saving it as a file produced something that couldn't be opened.
This is how I got around it with the help of some code by nitroxis on gitlab. Is there anything I am doing wrong here or is there a better way?
bits is a byte array.
Hope it helps someone and is it possible to create this header automatically with sharpCompress?