public class MessageOutputStream
extends java.io.OutputStream
OutputStream
Modifier and Type | Field and Description |
---|---|
private BlockingWriteCallback |
blocker |
private java.nio.ByteBuffer |
buffer |
private ByteBufferPool |
bufferPool |
private WriteCallback |
callback |
private boolean |
closed |
private BinaryFrame |
frame |
private long |
frameCount |
private static Logger |
LOG |
private OutgoingFrames |
outgoing |
Constructor and Description |
---|
MessageOutputStream(OutgoingFrames outgoing,
int bufferSize,
ByteBufferPool bufferPool) |
MessageOutputStream(WebSocketSession session) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
private void |
flush(boolean fin) |
private void |
notifyFailure(java.lang.Throwable failure) |
private void |
notifySuccess() |
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) |
private static final Logger LOG
private final OutgoingFrames outgoing
private final ByteBufferPool bufferPool
private final BlockingWriteCallback blocker
private long frameCount
private BinaryFrame frame
private java.nio.ByteBuffer buffer
private WriteCallback callback
private boolean closed
public MessageOutputStream(WebSocketSession session)
public MessageOutputStream(OutgoingFrames outgoing, int bufferSize, ByteBufferPool bufferPool)
public void write(byte[] bytes, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
private void flush(boolean fin) throws java.io.IOException
java.io.IOException
private void send(byte[] bytes, int offset, int length) throws java.io.IOException
java.io.IOException
public void setCallback(WriteCallback callback)
private void notifySuccess()
private void notifyFailure(java.lang.Throwable failure)