Class MessageOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.jetty.websocket.common.message.MessageOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Support for writing a single WebSocket BINARY message via a
OutputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockingWriteCallback
private ByteBuffer
private final org.eclipse.jetty.io.ByteBufferPool
private WriteCallback
private boolean
private BinaryFrame
private long
private static final org.eclipse.jetty.util.log.Logger
private final OutgoingFrames
-
Constructor Summary
ConstructorsConstructorDescriptionMessageOutputStream
(OutgoingFrames outgoing, int bufferSize, org.eclipse.jetty.io.ByteBufferPool bufferPool) MessageOutputStream
(WebSocketSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
flush()
private void
flush
(boolean fin) private void
notifyFailure
(Throwable failure) private void
private void
send
(byte[] bytes, int offset, int length) void
setCallback
(WriteCallback callback) void
write
(byte[] bytes, int off, int len) void
write
(int b) Methods inherited from class java.io.OutputStream
write
-
Field Details
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG -
outgoing
-
bufferPool
private final org.eclipse.jetty.io.ByteBufferPool bufferPool -
blocker
-
frameCount
private long frameCount -
frame
-
buffer
-
callback
-
closed
private boolean closed
-
-
Constructor Details
-
MessageOutputStream
-
MessageOutputStream
public MessageOutputStream(OutgoingFrames outgoing, int bufferSize, org.eclipse.jetty.io.ByteBufferPool bufferPool)
-
-
Method Details
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
- Throws:
IOException
-
send
- Throws:
IOException
-
setCallback
-
notifySuccess
private void notifySuccess() -
notifyFailure
-