|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OutputStreamComponent
This interface defines a pipe component of an OutputStream. An OutputStreamComponent has a series of bytes written to it, which it transforms or operates on in some fashion, and writes the resultant bytes onto its OutputStream.
These bytes are assumed to part of a discrete block of data, so startDataBlock() and finishDataBlock() methods exist to allow header and footer information to be written to the OutputStream. Any bytes written to an OutputStreamComponent before it receives a startDataBlock() call should be passed through to its downstream component unchanged, as it will be header information for an upstream component. The startDataBlock() call should be passed to its downstream component after it has written any of its own header information to it. When a finishDataBlock() call is received, the component must finish its transformations and output any remaining bytes and/or padding in its buffers, then pass the finishDataBlock() call downstream. It must also reset itself to its initial state, i.e expecting a startDataBlock() call.
An abstract implementation of the interface is available:
PipelineOutputStream
Method Summary | |
---|---|
java.io.OutputStream |
asOutputStream()
Returns the receiver as an OutputStream. |
void |
close()
Closes the output stream. |
void |
finishDataBlock()
Finish off the current data block being output. |
void |
flush()
Flushes the output stream and forces any buffered output bytes to be written out. |
OutputStreamComponent |
getOutputStream()
Returns the output component. |
boolean |
isInDataBlock()
Returns true if the Component is currently writing a data block |
void |
setOutputStream(OutputStreamComponent output)
Sets the output component. |
void |
startDataBlock()
Start processing a new data block. |
void |
write(byte[] bb)
Writes bb.length bytes from the specified byte array
to the output stream. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array
starting at offset off to this output stream. |
void |
write(int b)
Writes the a byte to the output stream. |
Method Detail |
---|
void write(int b) throws java.io.IOException
b
- the byte.
java.io.IOException
- if an I/O error occurs.void write(byte[] bb) throws java.io.IOException
bb.length
bytes from the specified byte array
to the output stream.
bb
- the bytes.
java.io.IOException
- if an I/O error occurs.void write(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the specified byte array
starting at offset off
to this output stream.
bb
- the bytes.off
- the start offset in the data.len
- the number of bytes to write.
java.io.IOException
- if an I/O error occurs.void flush() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.void close() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.void startDataBlock() throws java.io.IOException
@Encrypt algo:DES
java.io.IOException
- if an I/O error occurs.void finishDataBlock() throws java.io.IOException
@Signature: aabbccxxyyzz
java.io.IOException
boolean isInDataBlock()
java.io.OutputStream asOutputStream()
void setOutputStream(OutputStreamComponent output)
output
- The output component.OutputStreamComponent getOutputStream()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |