public class MessageInputStream extends InputStream implements MessageAppender
An InputStream that can access a queue of ByteBuffer payloads, along with expected InputStream blocking behavior.
| Constructor and Description |
|---|
MessageInputStream(LogicalConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendMessage(ByteBuffer payload,
boolean isLast)
Append the payload to the message.
|
void |
close() |
void |
mark(int readlimit) |
boolean |
markSupported() |
void |
messageComplete()
Notification that message is to be considered complete.
|
int |
read() |
void |
reset() |
available, read, read, skippublic MessageInputStream(LogicalConnection connection)
public void appendMessage(ByteBuffer payload, boolean isLast) throws IOException
MessageAppenderappendMessage in interface MessageAppenderpayload - the payload to append.isLast - flag indicating if this is the last part of the message or not.IOException - if unable to append the payloadpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic void messageComplete()
MessageAppenderAny cleanup or final actions should be taken here.
messageComplete in interface MessageAppenderpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic void reset()
throws IOException
reset in class InputStreamIOExceptionCopyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.