Top Description Inners Fields Constructors Methods
com.google.protobuf.nano

public final Class CodedOutputByteBufferNano

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.BufferOverflowException, .ByteBuffer, .ByteOrder, .ReadOnlyBufferException

Encodes and writes protocol message fields.

This class contains two kinds of methods: methods that write specific protocol message constructs and field types (e.g. writeTag and writeInt32) and methods that write low-level values (e.g. writeRawVarint32 and writeRawBytes). If you are writing encoded protocol messages, you should use the former methods, but if you are writing some other format of your own design, use the latter.

This class is totally unsynchronized.

Author
[email protected] Kenton Varda

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CodedOutputByteBufferNano.OutOfSpaceException

If you create a CodedOutputStream around a simple flat array, you must not attempt to write more bytes than the array has space.

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
public static final int
public static final int
private static final int

Constructor Summary

AccessConstructor and Description
private
CodedOutputByteBufferNano(final byte[] buffer, final int offset, final int length)

private

Method Summary

Modifier and TypeMethod and Description
public void
checkNoSpaceLeft()

Verifies that spaceLeft() returns zero.

public static int
computeBoolSize(final int fieldNumber, final boolean value)

Compute the number of bytes that would be needed to encode a bool field, including tag.

public static int
computeBoolSizeNoTag(final boolean value)

Compute the number of bytes that would be needed to encode a bool field.

public static int
computeBytesSize(final int fieldNumber, final byte[] value)

Compute the number of bytes that would be needed to encode a bytes field, including tag.

public static int
computeBytesSizeNoTag(final byte[] value)

Compute the number of bytes that would be needed to encode a bytes field.

public static int
computeDoubleSize(final int fieldNumber, final double value)

Compute the number of bytes that would be needed to encode a double field, including tag.

public static int
computeDoubleSizeNoTag(final double value)

Compute the number of bytes that would be needed to encode a double field, including tag.

public static int
computeEnumSize(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an enum field, including tag.

public static int
computeEnumSizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an enum field.

pack-priv static int
computeFieldSize(int number, int type, Object object)

public static int
computeFixed32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode a fixed32 field, including tag.

public static int
computeFixed32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode a fixed32 field.

public static int
computeFixed64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode a fixed64 field, including tag.

public static int
computeFixed64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode a fixed64 field.

public static int
computeFloatSize(final int fieldNumber, final float value)

Compute the number of bytes that would be needed to encode a float field, including tag.

public static int
computeFloatSizeNoTag(final float value)

Compute the number of bytes that would be needed to encode a float field, including tag.

public static int
computeGroupSize(final int fieldNumber, final MessageNano value)

Compute the number of bytes that would be needed to encode a group field, including tag.

public static int
computeGroupSizeNoTag(final MessageNano value)

Compute the number of bytes that would be needed to encode a group field.

public static int
computeInt32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an int32 field, including tag.

public static int
computeInt32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an int32 field, including tag.

public static int
computeInt64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode an int64 field, including tag.

public static int
computeInt64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode an int64 field, including tag.

public static int
computeMessageSize(final int fieldNumber, final MessageNano value)

Compute the number of bytes that would be needed to encode an embedded message field, including tag.

public static int
computeMessageSizeNoTag(final MessageNano value)

Compute the number of bytes that would be needed to encode an embedded message field.

public static int
computeRawVarint32Size(final int value)

Compute the number of bytes that would be needed to encode a varint.

public static int
computeRawVarint64Size(final long value)

Compute the number of bytes that would be needed to encode a varint.

public static int
computeSFixed32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an sfixed32 field, including tag.

public static int
computeSFixed32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an sfixed32 field.

public static int
computeSFixed64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode an sfixed64 field, including tag.

public static int
computeSFixed64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode an sfixed64 field.

public static int
computeSInt32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an sint32 field, including tag.

public static int
computeSInt32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an sint32 field.

public static int
computeSInt64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode an sint64 field, including tag.

public static int
computeSInt64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode an sint64 field.

public static int
computeStringSize(final int fieldNumber, final String value)

Compute the number of bytes that would be needed to encode a string field, including tag.

public static int
computeStringSizeNoTag(final String value)

Compute the number of bytes that would be needed to encode a string field.

public static int
computeTagSize(final int fieldNumber)

Compute the number of bytes that would be needed to encode a tag.

public static int
computeUInt32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode a uint32 field, including tag.

public static int
computeUInt32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode a uint32 field.

public static int
computeUInt64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode a uint64 field, including tag.

public static int
computeUInt64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode a uint64 field, including tag.

private static void
encode(CharSequence sequence, ByteBuffer byteBuffer)

Encodes sequence into UTF-8, in byteBuffer.

private static int
encode(CharSequence sequence, byte[] bytes, int offset, int length)

private static void
encodeDirect(CharSequence sequence, ByteBuffer byteBuffer)

private static int
encodedLength(CharSequence sequence)

Returns the number of bytes in the UTF-8-encoded form of sequence.

private static int
encodedLengthGeneral(CharSequence sequence, int start)

public static int

Returns:

An unsigned 32-bit integer, stored in a signed int because Java has no explicit unsigned support.
encodeZigZag32
(final int
A signed 32-bit integer.
n
)

Encode a ZigZag-encoded 32-bit value.

public static long

Returns:

An unsigned 64-bit integer, stored in a signed int because Java has no explicit unsigned support.
encodeZigZag64
(final long
A signed 64-bit integer.
n
)

Encode a ZigZag-encoded 64-bit value.

public static CodedOutputByteBufferNano
newInstance(final byte[] flatArray)

Create a new CodedOutputStream that writes directly to the given byte array.

public static CodedOutputByteBufferNano
newInstance(final byte[] flatArray, final int offset, final int length)

Create a new CodedOutputStream that writes directly to the given byte array slice.

public int
position()

Returns the position within the internal buffer.

public void
reset()

Resets the position within the internal buffer to zero.

public int
spaceLeft()

If writing to a flat array, return the space left in the array.

public void
writeBool(final int fieldNumber, final boolean value)

Write a bool field, including tag, to the stream.

public void
writeBoolNoTag(final boolean value)

Write a bool field to the stream.

public void
writeBytes(final int fieldNumber, final byte[] value)

Write a bytes field, including tag, to the stream.

public void
writeBytesNoTag(final byte[] value)

Write a bytes field to the stream.

public void
writeDouble(final int fieldNumber, final double value)

Write a double field, including tag, to the stream.

public void
writeDoubleNoTag(final double value)

Write a double field to the stream.

public void
writeEnum(final int fieldNumber, final int value)

Write an enum field, including tag, to the stream.

public void
writeEnumNoTag(final int value)

Write an enum field to the stream.

pack-priv void
writeField(int number, int type, Object value)

public void
writeFixed32(final int fieldNumber, final int value)

Write a fixed32 field, including tag, to the stream.

public void
writeFixed32NoTag(final int value)

Write a fixed32 field to the stream.

public void
writeFixed64(final int fieldNumber, final long value)

Write a fixed64 field, including tag, to the stream.

public void
writeFixed64NoTag(final long value)

Write a fixed64 field to the stream.

public void
writeFloat(final int fieldNumber, final float value)

Write a float field, including tag, to the stream.

public void
writeFloatNoTag(final float value)

Write a float field to the stream.

public void
writeGroup(final int fieldNumber, final MessageNano value)

Write a group field, including tag, to the stream.

public void
writeGroupNoTag(final MessageNano value)

Write a group field to the stream.

public void
writeInt32(final int fieldNumber, final int value)

Write an int32 field, including tag, to the stream.

public void
writeInt32NoTag(final int value)

Write an int32 field to the stream.

public void
writeInt64(final int fieldNumber, final long value)

Write an int64 field, including tag, to the stream.

public void
writeInt64NoTag(final long value)

Write an int64 field to the stream.

public void
writeMessage(final int fieldNumber, final MessageNano value)

Write an embedded message field, including tag, to the stream.

public void
writeMessageNoTag(final MessageNano value)

Write an embedded message field to the stream.

public void
writeRawByte(final byte value)

Write a single byte.

public void
writeRawByte(final int value)

Write a single byte, represented by an integer value.

public void
writeRawBytes(final byte[] value)

Write an array of bytes.

public void
writeRawBytes(final byte[] value, int offset, int length)

Write part of an array of bytes.

public void
writeRawLittleEndian32(final int value)

Write a little-endian 32-bit integer.

public void
writeRawLittleEndian64(final long value)

Write a little-endian 64-bit integer.

public void
writeRawVarint32(int value)

Encode and write a varint.

public void
writeRawVarint64(long value)

Encode and write a varint.

public void
writeSFixed32(final int fieldNumber, final int value)

Write an sfixed32 field, including tag, to the stream.

public void
writeSFixed32NoTag(final int value)

Write an sfixed32 field to the stream.

public void
writeSFixed64(final int fieldNumber, final long value)

Write an sfixed64 field, including tag, to the stream.

public void
writeSFixed64NoTag(final long value)

Write an sfixed64 field to the stream.

public void
writeSInt32(final int fieldNumber, final int value)

Write an sint32 field, including tag, to the stream.

public void
writeSInt32NoTag(final int value)

Write an sint32 field to the stream.

public void
writeSInt64(final int fieldNumber, final long value)

Write an sint64 field, including tag, to the stream.

public void
writeSInt64NoTag(final long value)

Write an sint64 field to the stream.

public void
writeString(final int fieldNumber, final String value)

Write a string field, including tag, to the stream.

public void
writeStringNoTag(final String value)

Write a string field to the stream.

public void
writeTag(final int fieldNumber, final int wireType)

Encode and write a tag.

public void
writeUInt32(final int fieldNumber, final int value)

Write a uint32 field, including tag, to the stream.

public void
writeUInt32NoTag(final int value)

Write a uint32 field to the stream.

public void
writeUInt64(final int fieldNumber, final long value)

Write a uint64 field, including tag, to the stream.

public void
writeUInt64NoTag(final long value)

Write a uint64 field to the stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private final ByteBuffer buffer
LITTLE_ENDIAN_32_SIZEback to summary
public static final int LITTLE_ENDIAN_32_SIZE
LITTLE_ENDIAN_64_SIZEback to summary
public static final int LITTLE_ENDIAN_64_SIZE
MAX_UTF8_EXPANSIONback to summary
private static final int MAX_UTF8_EXPANSION

Constructor Detail

CodedOutputByteBufferNanoback to summary
private CodedOutputByteBufferNano(final byte[] buffer, final int offset, final int length)
CodedOutputByteBufferNanoback to summary
private CodedOutputByteBufferNano(final ByteBuffer buffer)

Method Detail

checkNoSpaceLeftback to summary
public void checkNoSpaceLeft()

Verifies that spaceLeft() returns zero. It's common to create a byte array that is exactly big enough to hold a message, then write to it with a CodedOutputStream. Calling checkNoSpaceLeft() after writing verifies that the message was actually as big as expected, which can help catch bugs.

computeBoolSizeback to summary
public static int computeBoolSize(final int fieldNumber, final boolean value)

Compute the number of bytes that would be needed to encode a bool field, including tag.

computeBoolSizeNoTagback to summary
public static int computeBoolSizeNoTag(final boolean value)

Compute the number of bytes that would be needed to encode a bool field.

computeBytesSizeback to summary
public static int computeBytesSize(final int fieldNumber, final byte[] value)

Compute the number of bytes that would be needed to encode a bytes field, including tag.

computeBytesSizeNoTagback to summary
public static int computeBytesSizeNoTag(final byte[] value)

Compute the number of bytes that would be needed to encode a bytes field.

computeDoubleSizeback to summary
public static int computeDoubleSize(final int fieldNumber, final double value)

Compute the number of bytes that would be needed to encode a double field, including tag.

computeDoubleSizeNoTagback to summary
public static int computeDoubleSizeNoTag(final double value)

Compute the number of bytes that would be needed to encode a double field, including tag.

computeEnumSizeback to summary
public static int computeEnumSize(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an enum field, including tag. Caller is responsible for converting the enum value to its numeric value.

computeEnumSizeNoTagback to summary
public static int computeEnumSizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an enum field. Caller is responsible for converting the enum value to its numeric value.

computeFieldSizeback to summary
pack-priv static int computeFieldSize(int number, int type, Object object)
computeFixed32Sizeback to summary
public static int computeFixed32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode a fixed32 field, including tag.

computeFixed32SizeNoTagback to summary
public static int computeFixed32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode a fixed32 field.

computeFixed64Sizeback to summary
public static int computeFixed64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode a fixed64 field, including tag.

computeFixed64SizeNoTagback to summary
public static int computeFixed64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode a fixed64 field.

computeFloatSizeback to summary
public static int computeFloatSize(final int fieldNumber, final float value)

Compute the number of bytes that would be needed to encode a float field, including tag.

computeFloatSizeNoTagback to summary
public static int computeFloatSizeNoTag(final float value)

Compute the number of bytes that would be needed to encode a float field, including tag.

computeGroupSizeback to summary
public static int computeGroupSize(final int fieldNumber, final MessageNano value)

Compute the number of bytes that would be needed to encode a group field, including tag.

computeGroupSizeNoTagback to summary
public static int computeGroupSizeNoTag(final MessageNano value)

Compute the number of bytes that would be needed to encode a group field.

computeInt32Sizeback to summary
public static int computeInt32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an int32 field, including tag.

computeInt32SizeNoTagback to summary
public static int computeInt32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an int32 field, including tag.

computeInt64Sizeback to summary
public static int computeInt64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode an int64 field, including tag.

computeInt64SizeNoTagback to summary
public static int computeInt64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode an int64 field, including tag.

computeMessageSizeback to summary
public static int computeMessageSize(final int fieldNumber, final MessageNano value)

Compute the number of bytes that would be needed to encode an embedded message field, including tag.

computeMessageSizeNoTagback to summary
public static int computeMessageSizeNoTag(final MessageNano value)

Compute the number of bytes that would be needed to encode an embedded message field.

computeRawVarint32Sizeback to summary
public static int computeRawVarint32Size(final int value)

Compute the number of bytes that would be needed to encode a varint. value is treated as unsigned, so it won't be sign-extended if negative.

computeRawVarint64Sizeback to summary
public static int computeRawVarint64Size(final long value)

Compute the number of bytes that would be needed to encode a varint.

computeSFixed32Sizeback to summary
public static int computeSFixed32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an sfixed32 field, including tag.

computeSFixed32SizeNoTagback to summary
public static int computeSFixed32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an sfixed32 field.

computeSFixed64Sizeback to summary
public static int computeSFixed64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode an sfixed64 field, including tag.

computeSFixed64SizeNoTagback to summary
public static int computeSFixed64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode an sfixed64 field.

computeSInt32Sizeback to summary
public static int computeSInt32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode an sint32 field, including tag.

computeSInt32SizeNoTagback to summary
public static int computeSInt32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode an sint32 field.

computeSInt64Sizeback to summary
public static int computeSInt64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode an sint64 field, including tag.

computeSInt64SizeNoTagback to summary
public static int computeSInt64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode an sint64 field.

computeStringSizeback to summary
public static int computeStringSize(final int fieldNumber, final String value)

Compute the number of bytes that would be needed to encode a string field, including tag.

computeStringSizeNoTagback to summary
public static int computeStringSizeNoTag(final String value)

Compute the number of bytes that would be needed to encode a string field.

computeTagSizeback to summary
public static int computeTagSize(final int fieldNumber)

Compute the number of bytes that would be needed to encode a tag.

computeUInt32Sizeback to summary
public static int computeUInt32Size(final int fieldNumber, final int value)

Compute the number of bytes that would be needed to encode a uint32 field, including tag.

computeUInt32SizeNoTagback to summary
public static int computeUInt32SizeNoTag(final int value)

Compute the number of bytes that would be needed to encode a uint32 field.

computeUInt64Sizeback to summary
public static int computeUInt64Size(final int fieldNumber, final long value)

Compute the number of bytes that would be needed to encode a uint64 field, including tag.

computeUInt64SizeNoTagback to summary
public static int computeUInt64SizeNoTag(final long value)

Compute the number of bytes that would be needed to encode a uint64 field, including tag.

encodeback to summary
private static void encode(CharSequence sequence, ByteBuffer byteBuffer)

Encodes sequence into UTF-8, in byteBuffer. For a string, this method is equivalent to buffer.put(string.getBytes(UTF_8)), but is more efficient in both time and space. Bytes are written starting at the current position. This method requires paired surrogates, and therefore does not support chunking.

To ensure sufficient space in the output buffer, either call encodedLength to compute the exact amount needed, or leave room for 3 * sequence.length(), which is the largest possible number of bytes that any input can be encoded to.

Exceptions
IllegalArgumentException:
if sequence contains ill-formed UTF-16 (unpaired surrogates)
BufferOverflowException:
if sequence encoded in UTF-8 does not fit in byteBuffer's remaining space.
ReadOnlyBufferException:
if byteBuffer is a read-only buffer.
encodeback to summary
private static int encode(CharSequence sequence, byte[] bytes, int offset, int length)
encodeDirectback to summary
private static void encodeDirect(CharSequence sequence, ByteBuffer byteBuffer)
encodedLengthback to summary
private static int encodedLength(CharSequence sequence)

Returns the number of bytes in the UTF-8-encoded form of sequence. For a string, this method is equivalent to string.getBytes(UTF_8).length, but is more efficient in both time and space.

Exceptions
IllegalArgumentException:
if sequence contains ill-formed UTF-16 (unpaired surrogates)
encodedLengthGeneralback to summary
private static int encodedLengthGeneral(CharSequence sequence, int start)
encodeZigZag32back to summary
public static int encodeZigZag32(final int n)

Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.)

Parameters
n:int

A signed 32-bit integer.

Returns:int

An unsigned 32-bit integer, stored in a signed int because Java has no explicit unsigned support.

encodeZigZag64back to summary
public static long encodeZigZag64(final long n)

Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.)

Parameters
n:long

A signed 64-bit integer.

Returns:long

An unsigned 64-bit integer, stored in a signed int because Java has no explicit unsigned support.

newInstanceback to summary
public static CodedOutputByteBufferNano newInstance(final byte[] flatArray)

Create a new CodedOutputStream that writes directly to the given byte array. If more bytes are written than fit in the array, OutOfSpaceException will be thrown. Writing directly to a flat array is faster than writing to an OutputStream.

newInstanceback to summary
public static CodedOutputByteBufferNano newInstance(final byte[] flatArray, final int offset, final int length)

Create a new CodedOutputStream that writes directly to the given byte array slice. If more bytes are written than fit in the slice, OutOfSpaceException will be thrown. Writing directly to a flat array is faster than writing to an OutputStream.

positionback to summary
public int position()

Returns the position within the internal buffer.

resetback to summary
public void reset()

Resets the position within the internal buffer to zero.

See Also
position, spaceLeft
spaceLeftback to summary
public int spaceLeft()

If writing to a flat array, return the space left in the array. Otherwise, throws UnsupportedOperationException.

writeBoolback to summary
public void writeBool(final int fieldNumber, final boolean value) throws IOException

Write a bool field, including tag, to the stream.

writeBoolNoTagback to summary
public void writeBoolNoTag(final boolean value) throws IOException

Write a bool field to the stream.

writeBytesback to summary
public void writeBytes(final int fieldNumber, final byte[] value) throws IOException

Write a bytes field, including tag, to the stream.

writeBytesNoTagback to summary
public void writeBytesNoTag(final byte[] value) throws IOException

Write a bytes field to the stream.

writeDoubleback to summary
public void writeDouble(final int fieldNumber, final double value) throws IOException

Write a double field, including tag, to the stream.

writeDoubleNoTagback to summary
public void writeDoubleNoTag(final double value) throws IOException

Write a double field to the stream.

writeEnumback to summary
public void writeEnum(final int fieldNumber, final int value) throws IOException

Write an enum field, including tag, to the stream. Caller is responsible for converting the enum value to its numeric value.

writeEnumNoTagback to summary
public void writeEnumNoTag(final int value) throws IOException

Write an enum field to the stream. Caller is responsible for converting the enum value to its numeric value.

writeFieldback to summary
pack-priv void writeField(int number, int type, Object value) throws IOException
writeFixed32back to summary
public void writeFixed32(final int fieldNumber, final int value) throws IOException

Write a fixed32 field, including tag, to the stream.

writeFixed32NoTagback to summary
public void writeFixed32NoTag(final int value) throws IOException

Write a fixed32 field to the stream.

writeFixed64back to summary
public void writeFixed64(final int fieldNumber, final long value) throws IOException

Write a fixed64 field, including tag, to the stream.

writeFixed64NoTagback to summary
public void writeFixed64NoTag(final long value) throws IOException

Write a fixed64 field to the stream.

writeFloatback to summary
public void writeFloat(final int fieldNumber, final float value) throws IOException

Write a float field, including tag, to the stream.

writeFloatNoTagback to summary
public void writeFloatNoTag(final float value) throws IOException

Write a float field to the stream.

writeGroupback to summary
public void writeGroup(final int fieldNumber, final MessageNano value) throws IOException

Write a group field, including tag, to the stream.

writeGroupNoTagback to summary
public void writeGroupNoTag(final MessageNano value) throws IOException

Write a group field to the stream.

writeInt32back to summary
public void writeInt32(final int fieldNumber, final int value) throws IOException

Write an int32 field, including tag, to the stream.

writeInt32NoTagback to summary
public void writeInt32NoTag(final int value) throws IOException

Write an int32 field to the stream.

writeInt64back to summary
public void writeInt64(final int fieldNumber, final long value) throws IOException

Write an int64 field, including tag, to the stream.

writeInt64NoTagback to summary
public void writeInt64NoTag(final long value) throws IOException

Write an int64 field to the stream.

writeMessageback to summary
public void writeMessage(final int fieldNumber, final MessageNano value) throws IOException

Write an embedded message field, including tag, to the stream.

writeMessageNoTagback to summary
public void writeMessageNoTag(final MessageNano value) throws IOException

Write an embedded message field to the stream.

writeRawByteback to summary
public void writeRawByte(final byte value) throws IOException

Write a single byte.

writeRawByteback to summary
public void writeRawByte(final int value) throws IOException

Write a single byte, represented by an integer value.

writeRawBytesback to summary
public void writeRawBytes(final byte[] value) throws IOException

Write an array of bytes.

writeRawBytesback to summary
public void writeRawBytes(final byte[] value, int offset, int length) throws IOException

Write part of an array of bytes.

writeRawLittleEndian32back to summary
public void writeRawLittleEndian32(final int value) throws IOException

Write a little-endian 32-bit integer.

writeRawLittleEndian64back to summary
public void writeRawLittleEndian64(final long value) throws IOException

Write a little-endian 64-bit integer.

writeRawVarint32back to summary
public void writeRawVarint32(int value) throws IOException

Encode and write a varint. value is treated as unsigned, so it won't be sign-extended if negative.

writeRawVarint64back to summary
public void writeRawVarint64(long value) throws IOException

Encode and write a varint.

writeSFixed32back to summary
public void writeSFixed32(final int fieldNumber, final int value) throws IOException

Write an sfixed32 field, including tag, to the stream.

writeSFixed32NoTagback to summary
public void writeSFixed32NoTag(final int value) throws IOException

Write an sfixed32 field to the stream.

writeSFixed64back to summary
public void writeSFixed64(final int fieldNumber, final long value) throws IOException

Write an sfixed64 field, including tag, to the stream.

writeSFixed64NoTagback to summary
public void writeSFixed64NoTag(final long value) throws IOException

Write an sfixed64 field to the stream.

writeSInt32back to summary
public void writeSInt32(final int fieldNumber, final int value) throws IOException

Write an sint32 field, including tag, to the stream.

writeSInt32NoTagback to summary
public void writeSInt32NoTag(final int value) throws IOException

Write an sint32 field to the stream.

writeSInt64back to summary
public void writeSInt64(final int fieldNumber, final long value) throws IOException

Write an sint64 field, including tag, to the stream.

writeSInt64NoTagback to summary
public void writeSInt64NoTag(final long value) throws IOException

Write an sint64 field to the stream.

writeStringback to summary
public void writeString(final int fieldNumber, final String value) throws IOException

Write a string field, including tag, to the stream.

writeStringNoTagback to summary
public void writeStringNoTag(final String value) throws IOException

Write a string field to the stream.

writeTagback to summary
public void writeTag(final int fieldNumber, final int wireType) throws IOException

Encode and write a tag.

writeUInt32back to summary
public void writeUInt32(final int fieldNumber, final int value) throws IOException

Write a uint32 field, including tag, to the stream.

writeUInt32NoTagback to summary
public void writeUInt32NoTag(final int value) throws IOException

Write a uint32 field to the stream.

writeUInt64back to summary
public void writeUInt64(final int fieldNumber, final long value) throws IOException

Write a uint64 field, including tag, to the stream.

writeUInt64NoTagback to summary
public void writeUInt64NoTag(final long value) throws IOException

Write a uint64 field to the stream.

com.google.protobuf.nano back to summary

public Class CodedOutputByteBufferNano.OutOfSpaceException

extends IOException
Class Inheritance

If you create a CodedOutputStream around a simple flat array, you must not attempt to write more bytes than the array has space. Otherwise, this exception will be thrown.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
OutOfSpaceException(int position, int limit)

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.io.IOException.serialVersionUID.

Constructor Detail

OutOfSpaceExceptionback to summary
pack-priv OutOfSpaceException(int position, int limit)