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(Session session) |
MessageInputStream(Session session,
int timeoutMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendFrame(ByteBuffer framePayload,
boolean fin)
Append the frame 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(Session session)
public MessageInputStream(Session session, int timeoutMs)
public void appendFrame(ByteBuffer framePayload, boolean fin) throws IOException
MessageAppenderappendFrame in interface MessageAppenderframePayload - the frame payload to append.fin - flag indicating if this is the last part of the message or not.IOException - if unable to append the frame payloadpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreampublic 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 © 2010 - 2020 Adobe. All Rights Reserved