Bzip2LoadOptions

Inheritance: java.lang.Object

public class Bzip2LoadOptions

Options for loading Bzip2Archive. Contains event raised on extraction.

Constructors

ConstructorDescription
Bzip2LoadOptions()

Methods

MethodDescription
getExtractionProgressed()Gets an event that is raised when some bytes have been extracted.
setExtractionProgressed(Event<ProgressEventArgs> value)Sets an event that is raised when some bytes have been extracted.

Bzip2LoadOptions()

public Bzip2LoadOptions()

getExtractionProgressed()

public Event<ProgressEventArgs> getExtractionProgressed()

Gets an event that is raised when some bytes have been extracted.


     int[] percent = { 0 };
     long originalFileLength = 10_000_000;

     Bzip2LoadOptions loadOptions = new Bzip2LoadOptions();
     loadOptions.setExtractionProgressed((sender, args) -> {
         percent[0] = (int)((100 * (double)args.getProceededBytes()) / originalFileLength);
     });
 

Event sender is the Bzip2Archive instance which extraction is progressed. The ProgressEventArgs.getProceededBytes()(ProgressEventArgs.getProceededBytes()) is the number of bytes after extraction.

Returns: Event - an event that is raised when some bytes have been extracted

setExtractionProgressed(Event<ProgressEventArgs> value)

public void setExtractionProgressed(Event<ProgressEventArgs> value)

Sets an event that is raised when some bytes have been extracted.


     int[] percent = { 0 };
     long originalFileLength = 10_000_000;

     Bzip2LoadOptions loadOptions = new Bzip2LoadOptions();
     loadOptions.setExtractionProgressed((sender, args) -> {
         percent[0] = (int)((100 * (double)args.getProceededBytes()) / originalFileLength);
     });
 

Event sender is the Bzip2Archive instance which extraction is progressed. The ProgressEventArgs.getProceededBytes()(ProgressEventArgs.getProceededBytes()) is the number of bytes after extraction.

Parameters:

ParameterTypeDescription
valuecom.aspose.zip.Event<com.aspose.zip.ProgressEventArgs>an event that is raised when some bytes have been extracted