Top Description Methods
org.apache.commons.compress.compressors

public Interface CompressorStreamProvider

Known Direct Implementers
org.apache.commons.compress.compressors.CompressorStreamFactory
Imports
java.io.InputStream, .OutputStream, java.util.Set

Creates Compressor CompressorInputStreams and CompressorOutputStreams.
Since
1.13

Method Summary

Modifier and TypeMethod and Description
public CompressorInputStream

Returns:

compressor input stream
createCompressorInputStream
(String
of the compressor, i.e. gz, bzip2, xz, lzma, pack200, snappy-raw, snappy-framed, z or deflate
name
,
InputStream
the input stream
in
,
boolean
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.
decompressUntilEOF
)

Creates a compressor input stream from a compressor name and an input stream.

public CompressorOutputStream

Returns:

the compressor output stream
createCompressorOutputStream
(String
the compressor name, i.e. gz, bzip2, xz, pack200 or deflate
name
,
OutputStream
the output stream
out
)

Creates a compressor output stream from a compressor name and an output stream.

public Set<String>

Returns:

all the input compressor names for this provider
getInputStreamCompressorNames
()

Gets all the input stream compressor names for this provider

public Set<String>

Returns:

all the output compressor names for this provider
getOutputStreamCompressorNames
()

Gets all the output stream compressor names for this provider

Method Detail

createCompressorInputStreamback to summary
public CompressorInputStream createCompressorInputStream(String name, InputStream in, boolean decompressUntilEOF) throws CompressorException

Creates a compressor input stream from a compressor name and an input stream.

Parameters
name:String

of the compressor, i.e. gz, bzip2, xz, lzma, pack200, snappy-raw, snappy-framed, z or deflate

in:InputStream

the input stream

decompressUntilEOF:boolean

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.

Returns:CompressorInputStream

compressor input stream

Exceptions
CompressorException:
if the compressor name is not known
IllegalArgumentException:
if the name or input stream is null
createCompressorOutputStreamback to summary
public CompressorOutputStream createCompressorOutputStream(String name, OutputStream out) throws CompressorException

Creates a compressor output stream from a compressor name and an output stream.

Parameters
name:String

the compressor name, i.e. gz, bzip2, xz, pack200 or deflate

out:OutputStream

the output stream

Returns:CompressorOutputStream

the compressor output stream

Exceptions
CompressorException:
if the archiver name is not known
IllegalArgumentException:
if the archiver name or stream is null
getInputStreamCompressorNamesback to summary
public Set<String> getInputStreamCompressorNames()

Gets all the input stream compressor names for this provider

Returns:Set<String>

all the input compressor names for this provider

getOutputStreamCompressorNamesback to summary
public Set<String> getOutputStreamCompressorNames()

Gets all the output stream compressor names for this provider

Returns:Set<String>

all the output compressor names for this provider