private static final class CodedOutputStream.HeapNioEncoder extends CodedOutputStream.ArrayEncoder
CodedOutputStream
that writes directly to a heap ByteBuffer
. Writes are
done directly to the underlying array. The buffer position is only updated after a flush.CodedOutputStream.OutOfSpaceException
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
byteBuffer |
private int |
initialPosition |
DEFAULT_BUFFER_SIZE, LITTLE_ENDIAN_32_SIZE
Constructor and Description |
---|
HeapNioEncoder(java.nio.ByteBuffer byteBuffer) |
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flushes the stream and forces any buffered bytes to be written.
|
getTotalBytesWritten, spaceLeft, write, write, write, writeBool, writeByteArray, writeByteArray, writeByteArrayNoTag, writeByteBuffer, writeBytes, writeBytesNoTag, writeFixed32, writeFixed32NoTag, writeFixed64, writeFixed64NoTag, writeInt32, writeInt32NoTag, writeLazy, writeLazy, writeMessage, writeMessageNoTag, writeMessageSetExtension, writeRawBytes, writeRawMessageSetExtension, writeString, writeStringNoTag, writeTag, writeUInt32, writeUInt32NoTag, writeUInt64, writeUInt64NoTag
checkNoSpaceLeft, computeBoolSize, computeBoolSizeNoTag, computeByteArraySize, computeByteArraySizeNoTag, computeByteBufferSize, computeByteBufferSizeNoTag, computeBytesSize, computeBytesSizeNoTag, computeDoubleSize, computeDoubleSizeNoTag, computeEnumSize, computeEnumSizeNoTag, computeFixed32Size, computeFixed32SizeNoTag, computeFixed64Size, computeFixed64SizeNoTag, computeFloatSize, computeFloatSizeNoTag, computeGroupSize, computeGroupSizeNoTag, computeInt32Size, computeInt32SizeNoTag, computeInt64Size, computeInt64SizeNoTag, computeLazyFieldMessageSetExtensionSize, computeLazyFieldSize, computeLazyFieldSizeNoTag, computeLengthDelimitedFieldSize, computeMessageSetExtensionSize, computeMessageSize, computeMessageSizeNoTag, computePreferredBufferSize, computeRawMessageSetExtensionSize, computeRawVarint32Size, computeRawVarint64Size, computeSFixed32Size, computeSFixed32SizeNoTag, computeSFixed64Size, computeSFixed64SizeNoTag, computeSInt32Size, computeSInt32SizeNoTag, computeSInt64Size, computeSInt64SizeNoTag, computeStringSize, computeStringSizeNoTag, computeTagSize, computeUInt32Size, computeUInt32SizeNoTag, computeUInt64Size, computeUInt64SizeNoTag, encodeZigZag32, encodeZigZag64, inefficientWriteStringNoTag, isSerializationDeterministic, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newSafeInstance, newUnsafeInstance, useDeterministicSerialization, writeBoolNoTag, writeByteArrayNoTag, writeDouble, writeDoubleNoTag, writeEnum, writeEnumNoTag, writeFloat, writeFloatNoTag, writeGroup, writeGroupNoTag, writeInt64, writeInt64NoTag, writeRawByte, writeRawByte, writeRawBytes, writeRawBytes, writeRawBytes, writeRawLittleEndian32, writeRawLittleEndian64, writeRawVarint32, writeRawVarint64, writeSFixed32, writeSFixed32NoTag, writeSFixed64, writeSFixed64NoTag, writeSInt32, writeSInt32NoTag, writeSInt64, writeSInt64NoTag
private final java.nio.ByteBuffer byteBuffer
private int initialPosition
public void flush()
CodedOutputStream
flush
in class CodedOutputStream.ArrayEncoder