Bzip2SaveOptions

Inheritance: java.lang.Object

public class Bzip2SaveOptions

Options for saving a bzip2 archive.

Constructors

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

Methods

MethodDescription
getBlockSize()Block size in hundreds of kilobytes.
getCompressionThreads()Gets compression thread count.
setCompressionThreads(int value)Sets compression thread count.

Bzip2SaveOptions(int blockSize)

public Bzip2SaveOptions(int blockSize)

Initializes a new instance of the Bzip2SaveOptions class.


     try (FileOutputStream result = new FileOutputStream("archive.bz2")) {
         try (Bzip2Archive archive = new Bzip2Archive()) {
             archive.setSource("data.bin");
             archive.save(result, new Bzip2SaveOptions(9));
         }
     } catch (IOException ex) {
         System.out.println(ex);
     }
 

Parameters:

ParameterTypeDescription
blockSizeintBlock size in hundreds of kilobytes.

Bzip2SaveOptions()

public Bzip2SaveOptions()

Initializes a new instance of the Bzip2SaveOptions class with default block size, equals to 9 hundred of kilobytes.


     try (FileOutputStream result = new FileOutputStream("archive.bz2")) {
         try (Bzip2Archive archive = new Bzip2Archive()) {
             archive.setSource("data.bin");
             archive.save(result, new Bzip2SaveOptions());
         }
     } catch (IOException ex) {
         System.out.println(ex);
     }
 

getBlockSize()

public final int getBlockSize()

Block size in hundreds of kilobytes.

Returns: int - Block size in hundreds of kilobytes.

getCompressionThreads()

public final int getCompressionThreads()

Gets compression thread count. If the value greater than 1, multithreading compression will be used.

Returns: int - Compression thread count.

setCompressionThreads(int value)

public final void setCompressionThreads(int value)

Sets compression thread count. If the value greater than 1, multithreading compression will be used.

Parameters:

ParameterTypeDescription
valueintCompression thread count.