Top Description Fields Constructors Methods
org.apache.tools.ant.types.resources

public Class BZip2Resource

extends CompressedResource
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, org.apache.tools.bzip2.CBZip2InputStream, .CBZip2OutputStream

A Bzip2 compressed resource.

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

Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private static final char[]

Constructor Summary

AccessConstructor and Description
public
BZip2Resource()

A no-arg constructor

public
BZip2Resource(ResourceCollection
the resource to wrap.
other
)

Constructor with another resource to wrap.

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

the string "Bzip2".
getCompressionName
()

Implements abstract org.apache.tools.ant.types.resources.CompressedResource.getCompressionName.

Get the name of the compression method.
protected InputStream

Returns:

the wrapped stream.
wrapStream
(InputStream
the stream to wrap.
in
)

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Decompress on the fly using CBZip2InputStream.
protected OutputStream

Returns:

the wrapped stream.
wrapStream
(OutputStream
the stream to wrap.
out
)

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Compress on the fly using CBZip2OutputStream.
Inherited from org.apache.tools.ant.types.resources.CompressedResource:
toString

Field Detail

MAGICback to summary
private static final char[] MAGIC

Hides org.apache.tools.ant.types.Resource.MAGIC.

Constructor Detail

BZip2Resourceback to summary
public BZip2Resource()

A no-arg constructor

BZip2Resourceback to summary
public BZip2Resource(ResourceCollection other)

Constructor with another resource to wrap.

Parameters
other:ResourceCollection

the resource to wrap.

Method Detail

getCompressionNameback to summary
protected String getCompressionName()

Implements abstract org.apache.tools.ant.types.resources.CompressedResource.getCompressionName.

Get the name of the compression method.

Returns:String

the string "Bzip2".

Annotations
@Override
wrapStreamback to summary
protected InputStream wrapStream(InputStream in) throws IOException

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Decompress on the fly using CBZip2InputStream.

Parameters
in:InputStream

the stream to wrap.

Returns:InputStream

the wrapped stream.

Annotations
@Override
Exceptions
IOException:
if there is a problem.
wrapStreamback to summary
protected OutputStream wrapStream(OutputStream out) throws IOException

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Compress on the fly using CBZip2OutputStream.

Parameters
out:OutputStream

the stream to wrap.

Returns:OutputStream

the wrapped stream.

Annotations
@Override
Exceptions
IOException:
if there is a problem.