Factory to create Compressor[In|Out]putStreams from names. To add other
implementations you should extend CompressorStreamFactory and override the
appropriate methods (and call their implementation from super of course).

final InputStream is = new FileInputStream(input);
CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream(CompressorStreamFactory.BZIP2,
is);
IOUtils.copy(in, new FileOutputStream(output));
in.close();

This class is immutable

provided that the deprecated method setDecompressConcatenated is
not used.

CompressorStreamFactory

decompressUntilEOF - if true, decompress until the end of the input; if false, stop
after the first stream and leave the input position to point
to the next byte after the stream. This setting applies to the
gzip, bzip2 and xz formats only.

Since:

1.10

Method Detail

findAvailableCompressorInputStreamProviders

Constructs a new sorted map from input stream provider names to provider
objects.

The map returned by this method will have one entry for each provider for
which support is available in the current Java virtual machine. If two or
more supported provider have the same name then the resulting map will
contain just one of them; which one it will contain is not specified.

The invocation of this method, and the subsequent use of the resulting
map, may cause time-consuming disk or network I/O operations to occur.
This method is provided for applications that need to enumerate all of
the available providers, for example to allow user provider selection.

This method may return different results at different times if new
providers are dynamically made available to the current Java virtual
machine.

Returns:

An immutable, map from names to provider objects

Since:

1.13

findAvailableCompressorOutputStreamProviders

Constructs a new sorted map from output stream provider names to provider
objects.

The map returned by this method will have one entry for each provider for
which support is available in the current Java virtual machine. If two or
more supported provider have the same name then the resulting map will
contain just one of them; which one it will contain is not specified.

The invocation of this method, and the subsequent use of the resulting
map, may cause time-consuming disk or network I/O operations to occur.
This method is provided for applications that need to enumerate all of
the available providers, for example to allow user provider selection.

This method may return different results at different times if new
providers are dynamically made available to the current Java virtual
machine.

actualDecompressConcatenated - if true, decompress until the end of the input; if false, stop
after the first stream and leave the input position to point
to the next byte after the stream. This setting applies to the
gzip, bzip2 and xz formats only.