Project JXTA

net.jxta.impl.endpoint
Class MessageInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--net.jxta.impl.endpoint.MessageInputStream

public class MessageInputStream
extends java.io.InputStream

This class implements the formatting of a Message into the Endpoint JXTA Message representation. This class extends the InputStream interface so it can be used directely in order to get the bytes of the message.


Constructor Summary
MessageInputStream(MessageImpl m)
          Constructor.
 
Method Summary
 int available()
          This is the implementation of the InputStream API
 void buildWireMessage()
          Build the wire format of the message.
 net.jxta.endpoint.EndpointAddress getDestAddress()
          Get the destination address
 net.jxta.endpoint.EndpointAddress getSrcAddress()
          Get the source address
 int read()
           
 void setDestAddress(net.jxta.endpoint.EndpointAddress d)
          Sets the destination address.
 void setSrcAddress(net.jxta.endpoint.EndpointAddress s)
          Sets the source address.
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageInputStream

public MessageInputStream(MessageImpl m)
Constructor. This constructor is intented to be used for outgoing messages.
Method Detail

buildWireMessage

public void buildWireMessage()
Build the wire format of the message. This has to be done before the InputStream is consumed.

setDestAddress

public void setDestAddress(net.jxta.endpoint.EndpointAddress d)
Sets the destination address.

setSrcAddress

public void setSrcAddress(net.jxta.endpoint.EndpointAddress s)
Sets the source address.

getDestAddress

public net.jxta.endpoint.EndpointAddress getDestAddress()
Get the destination address

getSrcAddress

public net.jxta.endpoint.EndpointAddress getSrcAddress()
Get the source address

available

public int available()
              throws java.io.IOException
This is the implementation of the InputStream API
Overrides:
available in class java.io.InputStream

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.InputStream

Project JXTA