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| Constructor and Description |
|---|
ChannelBufferUnsafeFramedOutputStream(java.nio.channels.WritableByteChannel channel) |
ChannelBufferUnsafeFramedOutputStream(java.nio.channels.WritableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
flush() |
protected void |
flushBufferBlocking(java.nio.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, isSocketToSameHost, setParkedThread, writeBuffer, writeBuffered, writeBufferNoWaitpublic ChannelBufferUnsafeFramedOutputStream(java.nio.channels.WritableByteChannel channel)
throws java.io.IOException
java.io.IOExceptionpublic ChannelBufferUnsafeFramedOutputStream(java.nio.channels.WritableByteChannel channel,
int bufferSize)
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class ChannelBufferUnsafeOutputStreamjava.io.IOExceptionprotected void flushBufferBlocking(java.nio.ByteBuffer buffer)
throws java.io.IOException
flushBufferBlocking in class ChannelBufferUnsafeOutputStreamjava.io.IOExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.