org.apache.tools.ant.types.resources

Class BZip2Resource

public class BZip2Resource extends CompressedResource

A Bzip2 compressed resource.

Wraps around another resource, delegates all quries to that other resource but uncompresses/compresses streams on the fly.

Since: Ant 1.7

Constructor Summary
BZip2Resource()
A no-arg constructor
BZip2Resource(ResourceCollection other)
Constructor with another resource to wrap.
Method Summary
protected StringgetCompressionName()
Get the name of the compression method.
protected InputStreamwrapStream(InputStream in)
Decompress on the fly using CBZip2InputStream.
protected OutputStreamwrapStream(OutputStream out)
Compress on the fly using CBZip2OutputStream.

Constructor Detail

BZip2Resource

public BZip2Resource()
A no-arg constructor

BZip2Resource

public BZip2Resource(ResourceCollection other)
Constructor with another resource to wrap.

Parameters: other the resource to wrap.

Method Detail

getCompressionName

protected String getCompressionName()
Get the name of the compression method.

Returns: the string "Bzip2".

wrapStream

protected InputStream wrapStream(InputStream in)
Decompress on the fly using CBZip2InputStream.

Parameters: in the stream to wrap.

Returns: the wrapped stream.

Throws: IOException if there is a problem.

wrapStream

protected OutputStream wrapStream(OutputStream out)
Compress on the fly using CBZip2OutputStream.

Parameters: out the stream to wrap.

Returns: the wrapped stream.

Throws: IOException if there is a problem.