public static bool Compress(Stream stream_in, Stream stream_out, LZMADictionarySize dictionary_size, uint level, CompressProgressCallback progress_callback) { if (level > 9) { level = 9; } LowLevel.Compression.LZMA.CompressionCallback compression_callback = (uint processed_data, uint compressed_size) => { if (progress_callback != null) { progress_callback(new CompressionProgressData((uint)stream_in.Length, processed_data, compressed_size)); } }; return(LowLevel.Compression.LZMA.Compress(LowLevel.Compression.LZMA.LZMAStandardLayout, stream_in, stream_out, (uint)dictionary_size, level, compression_callback)); }
public static bool Compress(Stream stream_in, Stream stream_out, LZMADictionarySize dictionary_size, uint level, CompressProgressCallback progress_callback) { if (level > 9) level = 9; LowLevel.Compression.LZMA.CompressionCallback compression_callback = (uint processed_data, uint compressed_size) => { if (progress_callback != null) progress_callback(new CompressionProgressData((uint)stream_in.Length, processed_data, compressed_size)); }; return LowLevel.Compression.LZMA.Compress(LowLevel.Compression.LZMA.LZMAStandardLayout, stream_in, stream_out, (uint)dictionary_size, level, compression_callback); }