net.jxta.impl.endpoint
Class IncomingMessageTag
java.lang.Object
|
+--net.jxta.impl.endpoint.IncomingMessageTag
- public class IncomingMessageTag
- extends java.lang.Object
- implements MessageTag
An IncomingMessageTag encapsulates the name a chunk of data that has
been received.
This class also implements the InputStream API so it can directely
be used by the message layer to produce the bytes that have been received.
Constructor Summary |
IncomingMessageTag(byte[] src,
int start,
int end)
Default constructor |
Method Summary |
java.io.InputStream |
getInputStream()
returns an InputStream to the data of the tag. |
java.lang.String |
getTag()
Get the String representation of the tag. |
java.io.InputStream |
getWireFormatInputStream()
|
void |
setInputStream(java.io.InputStream thisStream)
This method needs to be provided in order to implement the MessageTag
interface, but since the stream has been set at the construction
of this object, it cannot be changed later on. |
void |
setTag(java.lang.String thisTag)
set this MessagesTag with the tag. |
void |
share()
This method causes the contents of the tag to be held locally by the tag
The result of which is that you may call getInputStream and
getWireFormatInputStream more than a single time. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
IncomingMessageTag
public IncomingMessageTag(byte[] src,
int start,
int end)
- Default constructor
setTag
public void setTag(java.lang.String thisTag)
throws java.io.IOException
- set this MessagesTag with the tag. If the tag
is invalid, IOException is thrown.
- Specified by:
- setTag in interface MessageTag
- Parameters:
tag
- String containing of the tag
getTag
public java.lang.String getTag()
- Get the String representation of the tag.
- Specified by:
- getTag in interface MessageTag
- Returns:
- the String representation of the tag.
setInputStream
public void setInputStream(java.io.InputStream thisStream)
throws java.io.IOException
- This method needs to be provided in order to implement the MessageTag
interface, but since the stream has been set at the construction
of this object, it cannot be changed later on. Just throw an
exception.
- Specified by:
- setInputStream in interface MessageTag
- Parameters:
thisStream
- InputStream provided by the caller.
getInputStream
public java.io.InputStream getInputStream()
- returns an InputStream to the data of the tag.
- Specified by:
- getInputStream in interface MessageTag
- Returns:
- returns an InputStream to the data of the tag.
getWireFormatInputStream
public java.io.InputStream getWireFormatInputStream()
- Specified by:
- getWireFormatInputStream in interface MessageTag
share
public void share()
- Description copied from interface: MessageTag
- This method causes the contents of the tag to be held locally by the tag
The result of which is that you may call getInputStream and
getWireFormatInputStream more than a single time.
- Specified by:
- share in interface MessageTag