public class FramingOutputStream extends ByteBufferOutputStream
write().
Note: The framing output stream does not synchronize writes to its internal buffer. It is intended to only be accessed from a single thread.
| Constructor and Description |
|---|
FramingOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
flip()
Flips and returns the buffer.
|
ByteBuffer |
frameAndReturnBuffer()
Writes the frame length to the beginning of our buffer and returns
it for writing to the appropriate channel.
|
void |
reset()
Resets our internal buffer.
|
void |
resetFrame()
Resets our internal buffer and prepares to write a new frame.
|
getBuffer, write, writeclose, flush, writepublic ByteBuffer flip()
ByteBufferOutputStreamByteBufferOutputStream.reset() to reset the buffer before
writing again.flip in class ByteBufferOutputStreampublic void reset()
ByteBufferOutputStreamreset in class ByteBufferOutputStreampublic ByteBuffer frameAndReturnBuffer()
resetFrame() when the frame has been written.public void resetFrame()
Copyright © 2015. All rights reserved.