Class MessageInputStream
java.lang.Object
java.io.InputStream
org.eclipse.jetty.websocket.core.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
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidConsumes the WebSocket frame, possibly asynchronously when this method has returned.voidclose()voidFails thisMessageSinkwith the given cause.intread()intread(byte[] b, int off, int len) intread(ByteBuffer buffer) voidsetTimeout(long timeoutMs) Methods inherited from class InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo 
- 
Constructor Details
- 
MessageInputStream
 
 - 
 - 
Method Details
- 
accept
Description copied from interface:MessageSinkConsumes the WebSocket frame, possibly asynchronously when this method has returned.
The callback argument must be completed when the frame payload is consumed.
The demand for more frames must be explicitly invoked, or arranged to be invoked asynchronously, by the implementation of this method, by calling
CoreSession.demand().- Specified by:
 acceptin interfaceMessageSink- Parameters:
 frame- the frame to consumecallback- the callback to complete when the frame is consumed
 - 
read
- Specified by:
 readin classInputStream- Throws:
 IOException
 - 
read
- Overrides:
 readin classInputStream- Throws:
 IOException
 - 
read
- Throws:
 IOException
 - 
fail
Description copied from interface:MessageSinkFails this
MessageSinkwith the given cause.- Specified by:
 failin interfaceMessageSink- Parameters:
 failure- the cause of the failure
 - 
close
public void close()- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Overrides:
 closein classInputStream
 - 
setTimeout
public void setTimeout(long timeoutMs)  
 -