public final class ChannelBufferUnsafeFramedOutputStream extends ChannelBufferUnsafeDataOutputStream
ChannelBufferUnsafeDataOutputStream to write in frames
i.e. write the size of frame at the start. This is like
TFramedTransport but the max frame size will be limited to the
buffer size so that we never create/allocate large buffers and the frame size
is only a hint to the receiving server to stop waiting for more data and
start processing it.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
doWriteFrameSize |
addrLimit, addrPosition, baseAddress, buffer, MIN_BUFFER_SIZEbytesWritten, channel, PARK_NANOS_MAX, parkedThread| Constructor and Description |
|---|
ChannelBufferUnsafeFramedOutputStream(WritableByteChannel channel) |
ChannelBufferUnsafeFramedOutputStream(WritableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
flush() |
protected void |
flushBufferBlocking(ByteBuffer buffer) |
putLong, putShort, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeLong, writeShort, writeUTF, writeUTFSegmentNoOverflowallocateBuffer, close, closeChannel, getInternalBuffer, isOpen, position, putByte, putInt, releaseBuffer, resetBufferPositions, write_, write, write, write, write, writeIntflushBufferNonBlockingBase, getBytesWritten, getParkedThread, getParkNanosMax, getUnderlyingChannel, writeBuffer, writeBuffered, writeBufferNonBlockingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, write, writeIntpublic ChannelBufferUnsafeFramedOutputStream(WritableByteChannel channel) throws IOException
IOExceptionpublic ChannelBufferUnsafeFramedOutputStream(WritableByteChannel channel, int bufferSize) throws IOException
IOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class ChannelBufferUnsafeOutputStreamIOExceptionprotected void flushBufferBlocking(ByteBuffer buffer) throws IOException
flushBufferBlocking in class ChannelBufferUnsafeOutputStreamIOExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.