Class LzmaArchiveSettings
Namespace: Aspose.Zip.LZMA
Assembly: Aspose.Zip.dll (25.1.0)
lzma 归档的设置。
public class LzmaArchiveSettings
继承
继承成员
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
备注
Lempel–Ziv–Markov 链算法 (LZMA) 是一种用于执行无损数据压缩的算法。 该算法使用一种与 LZ77 算法类似的字典压缩方案,具有高压缩比和可变的压缩字典大小。
了解更多: https://en.wikipedia.org/wiki/Lempel–Ziv–Markov_chain_algorithm
构造函数
LzmaArchiveSettings()
使用默认字典大小(等于 16 兆字节)初始化 Aspose.Zip.LZMA.LzmaArchiveSettings 类的新实例。
public LzmaArchiveSettings()
示例
using (LzmaArchive archive = new LzmaArchive(new LzmaArchiveSettings() { DictionarySize = 1048576 } )
{
archive.SetSource("data.bin);
archive.Save(lzmaFile);
}
属性
DictionarySize
字典(历史缓冲区)大小表示在内存中保留多少字节的最近处理的未压缩数据。 如果未设置,将根据条目大小选择。
public int DictionarySize { get; set; }
属性值
备注
字典越大,压缩比通常越好,但大于未压缩数据的字典会浪费 RAM。
CompressionProgressed
当压缩了一部分原始流时引发。
public event EventHandler<progresseventargs> CompressionProgressed
事件类型
EventHandler<ProgressEventArgs>
示例
lzmaArchiveSettings.CompressionProgressed += (s, e) => { int percent = (int)((100 * (long)e.ProceededBytes) / entrySourceStream.Length); };