Class PartialByteArrayMessageSink
java.lang.Object
org.eclipse.jetty.websocket.core.messages.AbstractMessageSink
org.eclipse.jetty.websocket.core.messages.PartialByteArrayMessageSink
- All Implemented Interfaces:
MessageSink
A MessageSink
implementation that delivers BINARY frames
to the application function passed to the constructor in the form
of a byte[]
.
-
Constructor Summary
ConstructorDescriptionPartialByteArrayMessageSink
(CoreSession session, MethodHandle methodHandle, boolean autoDemand) Creates a newPartialByteArrayMessageSink
. -
Method Summary
Methods inherited from class org.eclipse.jetty.websocket.core.messages.AbstractMessageSink
autoDemand, getCoreSession, getMethodHandle, isAutoDemand
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.websocket.core.messages.MessageSink
fail
-
Constructor Details
-
PartialByteArrayMessageSink
public PartialByteArrayMessageSink(CoreSession session, MethodHandle methodHandle, boolean autoDemand) Creates a newPartialByteArrayMessageSink
.- Parameters:
session
- the WebSocket sessionmethodHandle
- the application function to invoke when a new frame has arrivedautoDemand
- whether thisMessageSink
manages demand automatically
-
-
Method Details
-
accept
Description copied from interface:MessageSink
Consumes 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()
.- Parameters:
frame
- the frame to consumecallback
- the callback to complete when the frame is consumed
-