Class prominence.msg.MultiplexOutputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prominence.msg.MultiplexOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----java.io.DataOutputStream
                           |
                           +----prominence.msg.MessageOutput
                                   |
                                   +----prominence.msg.MultiplexOutputStream

public class MultiplexOutputStream
extends MessageOutput
A MessageOutput that attaches to an existing MessageOutput and attaches a multiplexing label to the header of each message that is transmitted.

The label is specified in the constructor and so one stream always attaches the same label.

See Also:
MultiplexInputStream

Variable Index

 o byteO
A ByteArrayOutputStream used to buffer the current message contents.
 o label
The multiplexing label.
 o o
The MessageOutput to which this is attached.

Constructor Index

 o MultiplexOutputStream(MessageOutput, String)
Creates a new MultiplexOutputStream.

Method Index

 o send()
Sends the current message with a multiplexing label header to the attached MessageOutput.
 o send(String[])
Sends the current message with a multiplexing label header to the attached MessageOutput.

Variables

 o o
  protected MessageOutput o
The MessageOutput to which this is attached.
 o byteO
  protected ByteArrayOutputStream byteO
A ByteArrayOutputStream used to buffer the current message contents.
 o label
  protected String label
The multiplexing label.

Constructors

 o MultiplexOutputStream
  public MultiplexOutputStream(MessageOutput o,
                               String label)
Creates a new MultiplexOutputStream.
Parameters:
o - The MessageOutput to which to send messages
label - The multiplexing label to be used by this stream

Methods

 o send
  public void send() throws IOException
Sends the current message with a multiplexing label header to the attached MessageOutput.
Throws: IOException
Occurs if there is a problem sending the message.
Overrides:
send in class MessageOutput
 o send
  public void send(String dst[]) throws IOException
Sends the current message with a multiplexing label header to the attached MessageOutput.

If the attached MessageOutput supports targeted sending then this method will succeed; otherwise an appropriate IOException will be thrown.

Parameters:
dst - The list of intended recipients
Throws: IOException
Occurs if there is a problem sending the message or the targeted send() method is not supported by the attached MessageOutput.
Overrides:
send in class MessageOutput

All Packages  Class Hierarchy  This Package  Previous  Next  Index