Class MessageInputStream
java.lang.Object
java.io.InputStream
org.eclipse.jetty.websocket.core.internal.messages.MessageInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,MessageSink
Support class for reading a WebSocket BINARY message via a InputStream.
An InputStream that can access a queue of ByteBuffer payloads, along with expected InputStream blocking behavior.
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
MessageInputStream
public MessageInputStream()
-
-
Method Details
-
accept
Description copied from interface:MessageSink
Consume the frame payload to the message.- Specified by:
accept
in interfaceMessageSink
- Parameters:
frame
- the frame, its payload (and fin state) to appendcallback
- the callback for how the frame was consumed
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Throws:
IOException
-
setTimeout
public void setTimeout(long timeoutMs) -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
fail
Description copied from interface:MessageSink
Fail the message sink.
Release any resources and fail all stored callbacks as
MessageSink.accept(Frame, Callback)
will never be called again.- Specified by:
fail
in interfaceMessageSink
- Parameters:
failure
- the failure that occurred.
-