Class prominence.msg.MessageOutputStream
All Packages Class Hierarchy This Package Previous Next Index
Class prominence.msg.MessageOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.FilterOutputStream
|
+----java.io.DataOutputStream
|
+----prominence.msg.MessageOutput
|
+----prominence.msg.MessageOutputStream
- public class MessageOutputStream
- extends MessageOutput
A MessageOutput that writes messages to an attached
OutputStream.
- See Also:
- MessageInputStream
-
byteO
- A ByteArrayOutputStream used to buffer the current message.
-
dataO
- A DataOutputStream attached to o.
-
o
- The attached OutputStream.
-
MessageOutputStream(OutputStream)
- Creates a new MessageOutputStream.
-
send()
- Sends a message to the attached stream.
o
protected OutputStream o
- The attached OutputStream.
dataO
protected DataOutputStream dataO
- A DataOutputStream attached to o.
byteO
protected ByteArrayOutputStream byteO
- A ByteArrayOutputStream used to buffer the current message.
MessageOutputStream
public MessageOutputStream(OutputStream o)
- Creates a new MessageOutputStream. Message data is
buffered internally until send() is called.
- Parameters:
- o - The OutputStream to which to write messages
send
public void send() throws IOException
- Sends a message to the attached stream. The message body length
is written as an int, followed by the message body itself;
the internal message buffer is then reset.
This method synchronizes on the attached stream.
- Throws: IOException
- Occurs if there is a problem writing to
the attached stream.
- Overrides:
- send in class MessageOutput
All Packages Class Hierarchy This Package Previous Next Index