public class MessageInputStream extends java.io.InputStream implements MessageAppender
An InputStream that can access a queue of ByteBuffer payloads, along with expected InputStream blocking behavior.
Constructor and Description |
---|
MessageInputStream() |
MessageInputStream(int timeoutMs) |
Modifier and Type | Method and Description |
---|---|
void |
appendFrame(java.nio.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() |
public MessageInputStream()
public MessageInputStream(int timeoutMs)
public void appendFrame(java.nio.ByteBuffer framePayload, boolean fin) throws java.io.IOException
MessageAppender
appendFrame
in interface MessageAppender
framePayload
- the frame payload to append.fin
- flag indicating if this is the last part of the message or not.java.io.IOException
- if unable to append the frame payloadpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public void messageComplete()
MessageAppender
Any cleanup or final actions should be taken here.
messageComplete
in interface MessageAppender
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
Copyright © 1995–2023 Webtide. All rights reserved.