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

Variable Index

 o byteO
A ByteArrayOutputStream used to buffer the current message.
 o dataO
A DataOutputStream attached to o.
 o o
The attached OutputStream.

Constructor Index

 o MessageOutputStream(OutputStream)
Creates a new MessageOutputStream.

Method Index

 o send()
Sends a message to the attached stream.

Variables

 o o
  protected OutputStream o
The attached OutputStream.
 o dataO
  protected DataOutputStream dataO
A DataOutputStream attached to o.
 o byteO
  protected ByteArrayOutputStream byteO
A ByteArrayOutputStream used to buffer the current message.

Constructors

 o 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

Methods

 o 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