Class MessageInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.eclipse.jetty.websocket.common.message.MessageInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable,MessageAppender
public class MessageInputStream extends InputStream implements MessageAppender
Support class for reading a (single) WebSocket BINARY message via a InputStream.An InputStream that can access a queue of ByteBuffer payloads, along with expected InputStream blocking behavior.
-
-
Constructor Summary
Constructors Constructor Description MessageInputStream()MessageInputStream(int timeoutMs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendFrame(ByteBuffer framePayload, boolean fin)Append the frame payload to the message.voidclose()voidmark(int readlimit)booleanmarkSupported()voidmessageComplete()Notification that message is to be considered complete.intread()voidreset()-
Methods inherited from class java.io.InputStream
available, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Method Detail
-
appendFrame
public void appendFrame(ByteBuffer framePayload, boolean fin) throws IOException
Description copied from interface:MessageAppenderAppend the frame payload to the message.- Specified by:
appendFramein interfaceMessageAppender- Parameters:
framePayload- the frame payload to append.fin- flag indicating if this is the last part of the message or not.- Throws:
IOException- if unable to append the frame payload
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
messageComplete
public void messageComplete()
Description copied from interface:MessageAppenderNotification that message is to be considered complete.Any cleanup or final actions should be taken here.
- Specified by:
messageCompletein interfaceMessageAppender
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
-