Top Description Fields Constructors Methods
org.apache.commons.compress.compressors.pack200

public Class Pack200CompressorOutputStream

extends CompressorOutputStream
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.util.Map, java.util.jar.JarInputStream, org.apache.commons.compress.compressors.CompressorOutputStream, org.apache.commons.compress.java.util.jar.Pack200

An output stream that compresses using the Pack200 format.
Since
1.3

Field Summary

Modifier and TypeField and Description
private final AbstractStreamBridge
private boolean
private final OutputStream
private final Map<String, String>

Constructor Summary

AccessConstructor and Description
public
Pack200CompressorOutputStream(final OutputStream
the stream to write to
out
)

Compresses the given stream, caching the compressed data in memory.

public
Pack200CompressorOutputStream(final OutputStream
the stream to write to
out
,
final Map<String, String>
Pack200 properties to use
props
)

Compresses the given stream, caching the compressed data in memory and using the given properties.

public
Pack200CompressorOutputStream(final OutputStream
the stream to write to
out
,
final Pack200Strategy
the strategy to use
mode
)

Compresses the given stream using the given strategy to cache the results.

public
Pack200CompressorOutputStream(final OutputStream
the stream to write to
out
,
final Pack200Strategy
the strategy to use
mode
,
final Map<String, String>
Pack200 properties to use
props
)

Compresses the given stream using the given strategy to cache the results and the given properties.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with this stream.
public void
public void
write(final byte[]
the data.
b
)

Overrides java.io.OutputStream.write.

Writes b.length bytes from the specified byte array to this output stream.
public void
write(final byte[]
the data.
b
,
final int
the start offset in the data.
from
,
final int
the number of bytes to write.
length
)

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.
public void
write(final int
the byte.
b
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

Field Detail

abstractStreamBridgeback to summary
private final AbstractStreamBridge abstractStreamBridge
finishedback to summary
private boolean finished
originalOutputback to summary
private final OutputStream originalOutput
propertiesback to summary
private final Map<String, String> properties

Constructor Detail

Pack200CompressorOutputStreamback to summary
public Pack200CompressorOutputStream(final OutputStream out) throws IOException

Compresses the given stream, caching the compressed data in memory.

Parameters
out:OutputStream

the stream to write to

Exceptions
IOException:
if writing fails
Pack200CompressorOutputStreamback to summary
public Pack200CompressorOutputStream(final OutputStream out, final Map<String, String> props) throws IOException

Compresses the given stream, caching the compressed data in memory and using the given properties.

Parameters
out:OutputStream

the stream to write to

props:Map<String, String>

Pack200 properties to use

Exceptions
IOException:
if writing fails
Pack200CompressorOutputStreamback to summary
public Pack200CompressorOutputStream(final OutputStream out, final Pack200Strategy mode) throws IOException

Compresses the given stream using the given strategy to cache the results.

Parameters
out:OutputStream

the stream to write to

mode:Pack200Strategy

the strategy to use

Exceptions
IOException:
if writing fails
Pack200CompressorOutputStreamback to summary
public Pack200CompressorOutputStream(final OutputStream out, final Pack200Strategy mode, final Map<String, String> props) throws IOException

Compresses the given stream using the given strategy to cache the results and the given properties.

Parameters
out:OutputStream

the stream to write to

mode:Pack200Strategy

the strategy to use

props:Map<String, String>

Pack200 properties to use

Exceptions
IOException:
if writing fails

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.OutputStream.close.

Closes this output stream and releases any system resources associated with this stream. The general contract of close is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
finishback to summary
public void finish() throws IOException
writeback to summary
public void write(final byte[] b) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes b.length bytes from the specified byte array to this output stream. The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length).

Parameters
b:byte[]

the data.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(final byte[] b, final int from, final int length) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Parameters
b:byte[]

the data.

from:int

the start offset in the data.

length:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
writeback to summary
public void write(final int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.