| java.lang.Object java.io.OutputStream java.io.FilterOutputStream org.apache.pluto.util.assemble.ear.AssemblySink
All known Subclasses: org.apache.pluto.util.assemble.ear.ByteArrayAssemblySink, org.apache.pluto.util.assemble.ear.FileAssemblySink,
AssemblySink | abstract class AssemblySink extends FilterOutputStream (Code) | | Used as a temporary container for assembled bytes, and for tracking
metadata specific to JarEntry objects, especially the
size of the JarEntry and its checksum.
|
Field Summary | |
final protected Checksum | CRC The CRC-32 calculator. | protected static int | DEFAULT_BUFLEN The default buffer length used when reading and
writing to the sink. | protected long | count The number of bytes written to the sink. |
Constructor Summary | |
| AssemblySink() Constructs a sink with null as an
underlying output stream. | | AssemblySink(OutputStream out) Constructs a sink with out as the
underlying output stream. |
Method Summary | |
public void | close() Closes the underlying output stream, resets the
checksum calculator, and clears the byte count. | long | getByteCount() Obtain the number of bytes written to the sink. | long | getCrc() Obtain the checksum of the bytes written to
the sink to this point. | public synchronized void | write(byte[] b) | public synchronized void | write(byte[] b, int off, int len) | public synchronized void | write(int b) | void | writeTo(OutputStream out) Write out the bytes in the sink to the supplied
output stream, using the default buffer length. | abstract void | writeTo(OutputStream out, int buflen) Write out the bytes in the sink to the supplied
output stream, using the supplied buffer length. |
DEFAULT_BUFLEN | protected static int DEFAULT_BUFLEN(Code) | | The default buffer length used when reading and
writing to the sink. By default the value is
4096 bytes.
|
count | protected long count(Code) | | The number of bytes written to the sink.
|
AssemblySink | AssemblySink()(Code) | | Constructs a sink with null as an
underlying output stream.
|
AssemblySink | AssemblySink(OutputStream out)(Code) | | Constructs a sink with out as the
underlying output stream. Method calls
on the sink are delegated to the underlying
output stream.
Parameters: out - the underlying output stream. |
close | public void close() throws IOException(Code) | | Closes the underlying output stream, resets the
checksum calculator, and clears the byte count.
|
getByteCount | long getByteCount()(Code) | | Obtain the number of bytes written to the sink.
the number of bytes written to the sink |
getCrc | long getCrc()(Code) | | Obtain the checksum of the bytes written to
the sink to this point.
the CRC-32 checksum of the bytes in the sink |
write | public synchronized void write(byte[] b, int off, int len) throws IOException(Code) | | |
writeTo | void writeTo(OutputStream out) throws IOException(Code) | | Write out the bytes in the sink to the supplied
output stream, using the default buffer length.
Parameters: out - the OutputStream the sink should be copied to. throws: IOException - |
writeTo | abstract void writeTo(OutputStream out, int buflen) throws IOException(Code) | | Write out the bytes in the sink to the supplied
output stream, using the supplied buffer length.
Parameters: out - the OutputStream the sink should be copied to. Parameters: buflen - the buffer length used when copying bytes throws: IOException - |
|
|