Bzip2CompressionSettings

Inheritance: java.lang.Object, com.aspose.zip.CompressionSettings

public class Bzip2CompressionSettings extends CompressionSettings

Settings for Bzip2 compression within a ZIP archive.

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding.

Constructors

ConstructorDescription
Bzip2CompressionSettings(int blockSize)Initializes a new instance of the Bzip2CompressionSettings class.
Bzip2CompressionSettings()Initializes a new instance of the Bzip2CompressionSettings class with default block size, equals to 9 hundred of kilobytes.

Methods

MethodDescription
getBlockSize()Block size in hundreds of kilobytes.

Bzip2CompressionSettings(int blockSize)

public Bzip2CompressionSettings(int blockSize)

Initializes a new instance of the Bzip2CompressionSettings class.

 try (Archive archive = new Archive(new ArchiveEntrySettings(new Bzip2CompressionSettings(1)))) {
     archive.createEntry("data.bin", "data.bin");
     archive.save(zipFile);
 }



**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| blockSize | int | Block size in hundreds of kilobytes. |

### Bzip2CompressionSettings() {#Bzip2CompressionSettings--}

public Bzip2CompressionSettings()



Initializes a new instance of the [Bzip2CompressionSettings](../../com.aspose.zip/bzip2compressionsettings) class with default block size, equals to 9 hundred of kilobytes.

     try (Archive archive = new Archive(new ArchiveEntrySettings(new Bzip2CompressionSettings()))) {
         archive.createEntry("data.bin", "data.bin");
         archive.save(zipFile);
     }
 
```



### getBlockSize() {#getBlockSize--}
```
public final int getBlockSize()
```


Block size in hundreds of kilobytes.

**Returns:**
int - block size in hundreds of kilobytes