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
-
byteO
- A ByteArrayOutputStream used to buffer the current message
contents.
-
label
- The multiplexing label.
-
o
- The MessageOutput to which this is attached.
-
MultiplexOutputStream(MessageOutput, String)
- Creates a new MultiplexOutputStream.
-
send()
- Sends the current message with a multiplexing label header to the
attached MessageOutput.
-
send(String[])
- Sends the current message with a multiplexing label header to the
attached MessageOutput.
o
protected MessageOutput o
- The MessageOutput to which this is attached.
byteO
protected ByteArrayOutputStream byteO
- A ByteArrayOutputStream used to buffer the current message
contents.
label
protected String label
- The multiplexing label.
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
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
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