|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Service provider interface for MessageOutputStream
Method Summary | |
void |
engineClose()
Close the stream Sends all data through the underlying stream and then calls the close() method of the underlying stream. |
void |
engineFlush()
Flush the stream What flushing does is format specific. |
void |
engineInit(java.io.OutputStream out,
java.security.SecureRandom sr)
Initializes this outputstream with the given outputstream as underlying stream and the given SecureRandom object. |
void |
engineSetAttribute(java.lang.String name,
java.lang.Object attr)
Set a format specific attribute. |
void |
engineWrite(byte[] b)
Write a complete bytearray to the stream |
void |
engineWrite(byte[] b,
int off,
int len)
Write the specified part of a bytearray to the stream. |
void |
engineWrite(int b)
Write a single byte to the stream |
Method Detail |
public void engineInit(java.io.OutputStream out, java.security.SecureRandom sr) throws java.lang.IllegalStateException, java.io.IOException, MessageStreamException
out
- The underlying outputstream this stream will write results to.sr
- A SecureRandom object used for any randomness needed.
java.lang.IllegalStateException
- if this message has been initialized
before.
java.io.IOException
- on a general IOException that is not format specific.
MessageStreamException
- on a variety of format specific problems.public void engineSetAttribute(java.lang.String name, java.lang.Object attr) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, MessageStreamException
name
- a name identifying the attributeattr
- the attribute itself
java.lang.IllegalStateException
- if this message has not been initialized
before.
java.lang.IllegalArgumentException
- if the attribute is not supported or the
given object does not have the right type.
MessageStreamException
- on a variety of format specific problems.public void engineWrite(byte[] b, int off, int len) throws java.io.IOException, MessageStreamException
b
- the dataoff
- the starting point of the write operationlen
- how many bytes to write
java.io.IOException
- on a general IOException that is not format specific.
MessageStreamException
- on a variety of format specific problems.public void engineWrite(byte[] b) throws java.io.IOException, MessageStreamException
b
- the data
java.io.IOException
- on a general IOException that is not format specific.
MessageStreamException
- on a variety of format specific problems.public void engineWrite(int b) throws java.io.IOException, MessageStreamException
b
- the byte to write
java.io.IOException
- on a general IOException that is not format specific.
MessageStreamException
- on a variety of format specific problems.public void engineFlush() throws java.io.IOException, MessageStreamException
What flushing does is format specific. The general contract is that as much bytes as possible are written to the underlying datastream, but no guarantees are given about any buffers left. The reason for this is because cryptographic protocols usually work on specific blocksizes and there usually are only handlers (padding) for incomplete blocks at the end of the stream.
This method should call the flush() method of the underlying outputstream after it is done.
java.io.IOException
- on a general IOException that is not format specific.
MessageStreamException
- on a variety of format specific problems.public void engineClose() throws java.io.IOException, MessageStreamException
Sends all data through the underlying stream and then calls the close() method of the underlying stream.
java.io.IOException
- on a general IOException that is not format specific.
MessageStreamException
- on a variety of format specific problems.
|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |