Class Bzip2CompressionSettings

Class Bzip2CompressionSettings

Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.2.0)

Settings needed for compressor or decompressor to work.

public class Bzip2CompressionSettings : CompressionSettings

Inheritance

objectCompressionSettingsBzip2CompressionSettings

Inherited Members

CompressionSettings.Bzip2, CompressionSettings.Deflate, CompressionSettings.EnhancedDeflate, CompressionSettings.Store, CompressionSettings.Lzma, CompressionSettings.Xz, CompressionSettings.PPMd, CompressionSettings.Zstd, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Remarks

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. See more: https://en.wikipedia.org/wiki/Bzip2

Constructors

Bzip2CompressionSettings(int)

Initializes a new instance of the Aspose.Zip.Saving.Bzip2CompressionSettings class.

public Bzip2CompressionSettings(int blockSize)

Parameters

blockSize int

Block size in hundreds of kilobytes.

Examples

using (Archive archive = new Archive(new ArchiveEntrySettings(new Bzip2CompressionSettings(1))))
{
    archive.CreateEntry("data.bin", "data.bin");
    archive.Save(zipFile);
}

Exceptions

ArgumentOutOfRangeException

Block size is not between 1 and 9.

Bzip2CompressionSettings()

Initializes a new instance of the Aspose.Zip.Saving.Bzip2CompressionSettings class with default block size, equals to 9 hundred of kilobytes.

public Bzip2CompressionSettings()

Examples

using (Archive archive = new Archive(new ArchiveEntrySettings(new Bzip2CompressionSettings())))
{
    archive.CreateEntry("data.bin", "data.bin");
    archive.Save(zipFile);
}

Properties

BlockSize

Block size in hundreds of kilobytes.

public int BlockSize { get; }

Property Value

int

 English