Classes | |
class | AbstractBufferedEncoder |
class | ArrayEncoder |
class | ByteOutputEncoder |
class | HeapNioEncoder |
class | OutOfSpaceException |
class | OutputStreamEncoder |
class | SafeDirectNioEncoder |
class | UnsafeDirectNioEncoder |
Public Member Functions | |
final void | checkNoSpaceLeft () |
abstract void | flush () throws IOException |
abstract int | getTotalBytesWritten () |
abstract int | spaceLeft () |
void | useDeterministicSerialization () |
abstract void | write (byte value) throws IOException |
abstract void | write (byte[] value, int offset, int length) throws IOException |
abstract void | write (ByteBuffer value) throws IOException |
abstract void | writeBool (int fieldNumber, boolean value) throws IOException |
final void | writeBoolNoTag (final boolean value) throws IOException |
abstract void | writeByteArray (int fieldNumber, byte[] value) throws IOException |
abstract void | writeByteArray (int fieldNumber, byte[] value, int offset, int length) throws IOException |
final void | writeByteArrayNoTag (final byte[] value) throws IOException |
abstract void | writeByteBuffer (int fieldNumber, ByteBuffer value) throws IOException |
abstract void | writeBytes (int fieldNumber, ByteString value) throws IOException |
abstract void | writeBytesNoTag (final ByteString value) throws IOException |
final void | writeDouble (final int fieldNumber, final double value) throws IOException |
final void | writeDoubleNoTag (final double value) throws IOException |
final void | writeEnum (final int fieldNumber, final int value) throws IOException |
final void | writeEnumNoTag (final int value) throws IOException |
abstract void | writeFixed32 (int fieldNumber, int value) throws IOException |
abstract void | writeFixed32NoTag (int value) throws IOException |
abstract void | writeFixed64 (int fieldNumber, long value) throws IOException |
abstract void | writeFixed64NoTag (long value) throws IOException |
final void | writeFloat (final int fieldNumber, final float value) throws IOException |
final void | writeFloatNoTag (final float value) throws IOException |
final void | writeGroup (final int fieldNumber, final MessageLite value) throws IOException |
final void | writeGroupNoTag (final MessageLite value) throws IOException |
abstract void | writeInt32 (int fieldNumber, int value) throws IOException |
abstract void | writeInt32NoTag (final int value) throws IOException |
final void | writeInt64 (final int fieldNumber, final long value) throws IOException |
final void | writeInt64NoTag (final long value) throws IOException |
abstract void | writeLazy (byte[] value, int offset, int length) throws IOException |
abstract void | writeLazy (ByteBuffer value) throws IOException |
abstract void | writeMessage (final int fieldNumber, final MessageLite value) throws IOException |
abstract void | writeMessageNoTag (final MessageLite value) throws IOException |
abstract void | writeMessageSetExtension (final int fieldNumber, final MessageLite value) throws IOException |
final void | writeRawByte (final byte value) throws IOException |
final void | writeRawByte (final int value) throws IOException |
final void | writeRawBytes (final byte[] value) throws IOException |
final void | writeRawBytes (final byte[] value, int offset, int length) throws IOException |
abstract void | writeRawBytes (final ByteBuffer value) throws IOException |
final void | writeRawBytes (final ByteString value) throws IOException |
final void | writeRawLittleEndian32 (final int value) throws IOException |
final void | writeRawLittleEndian64 (final long value) throws IOException |
abstract void | writeRawMessageSetExtension (final int fieldNumber, final ByteString value) throws IOException |
final void | writeRawVarint32 (int value) throws IOException |
final void | writeRawVarint64 (long value) throws IOException |
final void | writeSFixed32 (final int fieldNumber, final int value) throws IOException |
final void | writeSFixed32NoTag (final int value) throws IOException |
final void | writeSFixed64 (final int fieldNumber, final long value) throws IOException |
final void | writeSFixed64NoTag (final long value) throws IOException |
final void | writeSInt32 (final int fieldNumber, final int value) throws IOException |
final void | writeSInt32NoTag (final int value) throws IOException |
final void | writeSInt64 (final int fieldNumber, final long value) throws IOException |
final void | writeSInt64NoTag (final long value) throws IOException |
abstract void | writeString (int fieldNumber, String value) throws IOException |
abstract void | writeStringNoTag (String value) throws IOException |
abstract void | writeTag (int fieldNumber, int wireType) throws IOException |
abstract void | writeUInt32 (int fieldNumber, int value) throws IOException |
abstract void | writeUInt32NoTag (int value) throws IOException |
abstract void | writeUInt64 (int fieldNumber, long value) throws IOException |
abstract void | writeUInt64NoTag (long value) throws IOException |
Static Public Member Functions | |
static int | computeBoolSize (final int fieldNumber, final boolean value) |
static int | computeBoolSizeNoTag (@SuppressWarnings("unused") final boolean unused) |
static int | computeByteArraySize (final int fieldNumber, final byte[] value) |
static int | computeByteArraySizeNoTag (final byte[] value) |
static int | computeByteBufferSize (final int fieldNumber, final ByteBuffer value) |
static int | computeByteBufferSizeNoTag (final ByteBuffer value) |
static int | computeBytesSize (final int fieldNumber, final ByteString value) |
static int | computeBytesSizeNoTag (final ByteString value) |
static int | computeDoubleSize (final int fieldNumber, final double value) |
static int | computeDoubleSizeNoTag (@SuppressWarnings("unused") final double unused) |
static int | computeEnumSize (final int fieldNumber, final int value) |
static int | computeEnumSizeNoTag (final int value) |
static int | computeFixed32Size (final int fieldNumber, final int value) |
static int | computeFixed32SizeNoTag (@SuppressWarnings("unused") final int unused) |
static int | computeFixed64Size (final int fieldNumber, final long value) |
static int | computeFixed64SizeNoTag (@SuppressWarnings("unused") final long unused) |
static int | computeFloatSize (final int fieldNumber, final float value) |
static int | computeFloatSizeNoTag (@SuppressWarnings("unused") final float unused) |
static int | computeGroupSize (final int fieldNumber, final MessageLite value) |
static int | computeGroupSizeNoTag (final MessageLite value) |
static int | computeInt32Size (final int fieldNumber, final int value) |
static int | computeInt32SizeNoTag (final int value) |
static int | computeInt64Size (final int fieldNumber, final long value) |
static int | computeInt64SizeNoTag (final long value) |
static int | computeLazyFieldMessageSetExtensionSize (final int fieldNumber, final LazyFieldLite value) |
static int | computeLazyFieldSize (final int fieldNumber, final LazyFieldLite value) |
static int | computeLazyFieldSizeNoTag (final LazyFieldLite value) |
static int | computeMessageSetExtensionSize (final int fieldNumber, final MessageLite value) |
static int | computeMessageSize (final int fieldNumber, final MessageLite value) |
static int | computeMessageSizeNoTag (final MessageLite value) |
static int | computeRawMessageSetExtensionSize (final int fieldNumber, final ByteString value) |
static int | computeRawVarint32Size (final int value) |
static int | computeRawVarint64Size (long value) |
static int | computeSFixed32Size (final int fieldNumber, final int value) |
static int | computeSFixed32SizeNoTag (@SuppressWarnings("unused") final int unused) |
static int | computeSFixed64Size (final int fieldNumber, final long value) |
static int | computeSFixed64SizeNoTag (@SuppressWarnings("unused") final long unused) |
static int | computeSInt32Size (final int fieldNumber, final int value) |
static int | computeSInt32SizeNoTag (final int value) |
static int | computeSInt64Size (final int fieldNumber, final long value) |
static int | computeSInt64SizeNoTag (final long value) |
static int | computeStringSize (final int fieldNumber, final String value) |
static int | computeStringSizeNoTag (final String value) |
static int | computeTagSize (final int fieldNumber) |
static int | computeUInt32Size (final int fieldNumber, final int value) |
static int | computeUInt32SizeNoTag (final int value) |
static int | computeUInt64Size (final int fieldNumber, final long value) |
static int | computeUInt64SizeNoTag (long value) |
static int | encodeZigZag32 (final int n) |
static long | encodeZigZag64 (final long n) |
static CodedOutputStream | newInstance (ByteBuffer buffer) |
static CodedOutputStream | newInstance (ByteBuffer byteBuffer, @SuppressWarnings("unused") int unused) |
static CodedOutputStream | newInstance (final byte[] flatArray) |
static CodedOutputStream | newInstance (final byte[] flatArray, final int offset, final int length) |
static CodedOutputStream | newInstance (final OutputStream output) |
static CodedOutputStream | newInstance (final OutputStream output, final int bufferSize) |
Static Public Attributes | |
static final int | DEFAULT_BUFFER_SIZE = 4096 |
static final int | LITTLE_ENDIAN_32_SIZE = FIXED32_SIZE |
Private Member Functions | |
CodedOutputStream () | |
Private Attributes | |
boolean | serializationDeterministic |
Static Private Attributes | |
static final boolean | HAS_UNSAFE_ARRAY_OPERATIONS = UnsafeUtil.hasUnsafeArrayOperations() |
static final Logger | logger = Logger.getLogger(CodedOutputStream.class.getName()) |
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.
Definition at line 59 of file CodedOutputStream.java.
|
inlineprivate |
Definition at line 224 of file CodedOutputStream.java.
|
inline |
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
. Calling
after writing verifies that the message was actually as big as expected, which can help catch bugs.
Definition at line 937 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 603 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 826 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 636 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 866 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 644 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 871 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 628 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 861 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 596 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 821 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an enum field, including tag. The provided value is the numeric value used to represent the enum value on the wire (not the enum ordinal value).
Definition at line 612 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an enum field. The provided value is the numeric value used to represent the enum value on the wire (not the enum ordinal value).
Definition at line 834 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 532 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 749 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 572 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 800 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 588 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 813 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 1058 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 1075 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 508 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 717 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 548 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 762 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an lazily parsed MessageSet extension field to the stream. For historical reasons, the wire format differs from normal fields.
Definition at line 699 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an embedded message in lazy field, including tag.
Definition at line 652 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an embedded message stored in lazy field.
Definition at line 856 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a MessageSet extension to the stream. For historical reasons, the wire format differs from normal fields.
Definition at line 677 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an embedded message field, including tag.
Definition at line 660 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an embedded message field.
Definition at line 876 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an unparsed MessageSet extension field to the stream. For historical reasons, the wire format differs from normal fields.
Definition at line 687 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a varint.
is treated as unsigned, so it won't be sign-extended if negative.
Definition at line 1113 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a varint.
Definition at line 1123 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 540 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field.
Definition at line 754 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 580 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field.
Definition at line 805 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 524 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field.
Definition at line 744 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field, including tag.
Definition at line 564 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode an
field.
Definition at line 795 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 620 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 839 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a tag.
Definition at line 709 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 516 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field.
Definition at line 727 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 556 of file CodedOutputStream.java.
|
inlinestatic |
Compute the number of bytes that would be needed to encode a
field, including tag.
Definition at line 770 of file CodedOutputStream.java.
|
inlinestatic |
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.)
n | A signed 32-bit integer. |
Definition at line 898 of file CodedOutputStream.java.
|
inlinestatic |
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.)
n | A signed 64-bit integer. |
Definition at line 912 of file CodedOutputStream.java.
|
abstract |
Flushes the stream and forces any buffered bytes to be written. This does not flush the underlying OutputStream.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.HeapNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Get the total number of bytes successfully written to this stream. The returned value is not guaranteed to be accurate if exceptions have been found in the middle of writing.
Reimplemented in com.google.protobuf.CodedOutputStream.AbstractBufferedEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
inlinestatic |
Create a new
that writes to the given ByteBuffer.
Definition at line 130 of file CodedOutputStream.java.
|
inlinestatic |
Create a new
that writes to the given ByteBuffer.
Definition at line 199 of file CodedOutputStream.java.
|
inlinestatic |
Create a new
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
. See also {}.
Definition at line 114 of file CodedOutputStream.java.
|
inlinestatic |
Create a new
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
. See also ByteString#newCodedBuilder.
Definition at line 124 of file CodedOutputStream.java.
|
inlinestatic |
Create a new
wrapping the given
.
NOTE: The provided OutputStream MUST NOT retain access or modify the provided byte arrays. Doing so may result in corrupted data, which would be difficult to debug.
Definition at line 92 of file CodedOutputStream.java.
|
inlinestatic |
Create a new
wrapping the given
with a given buffer size.
NOTE: The provided OutputStream MUST NOT retain access or modify the provided byte arrays. Doing so may result in corrupted data, which would be difficult to debug.
Definition at line 104 of file CodedOutputStream.java.
|
abstract |
If writing to a flat array, return the space left in the array. Otherwise, throws
.
Reimplemented in com.google.protobuf.CodedOutputStream.AbstractBufferedEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
inline |
Configures serialization to be deterministic.
The deterministic serialization guarantees that for a given binary, equal (defined by the
methods in protos) messages will always be serialized to the same bytes. This implies:
Note the deterministic serialization is NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields. Users who need canonical serialization, e.g. persistent storage in a canonical form, fingerprinting, etc, should define their own canonicalization specification and implement the serializer using reflection APIs rather than relying on this API.
Once set, the serializer will: (Note this is an implementation detail and may subject to change in the future)
Definition at line 181 of file CodedOutputStream.java.
Writes a single byte.
value | the byte to be written |
IOException | thrown if an error occurred while writing |
Reimplemented from com.google.protobuf.ByteOutput.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Writes a sequence of bytes. The ByteOutput must copy
if it will not be processed prior to the return of this method call, since
may be reused/altered by the caller.
NOTE: This method MUST NOT modify the
. Doing so is a programming error and will lead to data corruption which will be difficult to debug.
value | the bytes to be written |
offset | the offset of the start of the writable range |
length | the number of bytes to write starting from |
IOException | thrown if an error occurred while writing |
Reimplemented from com.google.protobuf.ByteOutput.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Writes a sequence of bytes. The ByteOutput must copy
if it will not be processed prior to the return of this method call, since
may be reused/altered by the caller.
NOTE: This method MUST NOT modify the
. Doing so is a programming error and will lead to data corruption which will be difficult to debug.
value | the bytes to be written. Upon returning from this call, the of this buffer will be set to the limit
|
IOException | thrown if an error occurred while writing |
Reimplemented from com.google.protobuf.ByteOutput.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
inline |
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field, including tag, to the stream. This method will write all content of the ByteBuffer regardless of the current position and limit (i.e., the number of bytes to be written is value.capacity(), not value.remaining()). Furthermore, this method doesn't alter the state of the passed-in ByteBuffer. Its position, limit, mark, etc. will remain unchanged. If you only want to write the remaining bytes of a ByteBuffer, you can call
.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.ArrayEncoder, and com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder.
|
inline |
Write a
field, including tag, to the stream.
Definition at line 283 of file CodedOutputStream.java.
|
inline |
|
inline |
Write an enum field, including tag, to the stream. The provided value is the numeric value used to represent the enum value on the wire (not the enum ordinal value).
Definition at line 295 of file CodedOutputStream.java.
|
inline |
Write an enum field to the stream. The provided value is the numeric value used to represent the enum value on the wire (not the enum ordinal value).
Definition at line 454 of file CodedOutputStream.java.
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.ArrayEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, and com.google.protobuf.CodedOutputStream.ByteOutputEncoder.
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.ArrayEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, and com.google.protobuf.CodedOutputStream.ByteOutputEncoder.
|
inline |
Write a
field, including tag, to the stream.
Definition at line 278 of file CodedOutputStream.java.
|
inline |
|
inline |
Write a
field, including tag, to the stream.
Definition at line 1012 of file CodedOutputStream.java.
|
inline |
Write a
field to the stream.
Definition at line 1037 of file CodedOutputStream.java.
|
abstract |
Write an
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write an
field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
inline |
Write an
field, including tag, to the stream.
Definition at line 255 of file CodedOutputStream.java.
|
inline |
|
abstract |
Writes a sequence of bytes. The ByteOutput is free to retain a reference to the value beyond the scope of this method call (e.g. write later) since it is considered immutable and is guaranteed not to change by the caller.
NOTE: This method MUST NOT modify the
. Doing so is a programming error and will lead to data corruption which will be difficult to debug.
value | the bytes to be written |
offset | the offset of the start of the writable range |
length | the number of bytes to write starting from |
IOException | thrown if an error occurred while writing |
Reimplemented from com.google.protobuf.ByteOutput.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Writes a sequence of bytes. The ByteOutput is free to retain a reference to the value beyond the scope of this method call (e.g. write later) since it is considered immutable and is guaranteed not to change by the caller.
NOTE: This method MUST NOT modify the
. Doing so is a programming error and will lead to data corruption which will be difficult to debug.
value | the bytes to be written. Upon returning from this call, the of this buffer will be set to the limit
|
IOException | thrown if an error occurred while writing |
Reimplemented from com.google.protobuf.ByteOutput.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write an embedded message field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write an embedded message field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a MessageSet extension field to the stream. For historical reasons, the wire format differs from normal fields.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
inline |
Write a single byte.
Definition at line 328 of file CodedOutputStream.java.
|
inline |
Write a single byte, represented by an integer value.
Definition at line 333 of file CodedOutputStream.java.
|
inline |
Write an array of bytes.
Definition at line 338 of file CodedOutputStream.java.
|
inline |
Write part of an array of bytes.
Definition at line 343 of file CodedOutputStream.java.
|
abstract |
Write a ByteBuffer. This method will write all content of the ByteBuffer regardless of the current position and limit (i.e., the number of bytes to be written is value.capacity(), not value.remaining()). Furthermore, this method doesn't alter the state of the passed-in ByteBuffer. Its position, limit, mark, etc. will remain unchanged. If you only want to write the remaining bytes of a ByteBuffer, you can call
.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.ArrayEncoder, and com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder.
|
inline |
Write a byte string.
Definition at line 348 of file CodedOutputStream.java.
|
inline |
Write a little-endian 32-bit integer.
Definition at line 1133 of file CodedOutputStream.java.
|
inline |
Write a little-endian 64-bit integer.
Definition at line 1143 of file CodedOutputStream.java.
|
abstract |
Write an unparsed MessageSet extension field to the stream. For historical reasons, the wire format differs from normal fields.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
inline |
Encode and write a varint.
is treated as unsigned, so it won't be sign-extended if negative.
Definition at line 1092 of file CodedOutputStream.java.
|
inline |
Encode and write a varint.
Definition at line 1102 of file CodedOutputStream.java.
|
inline |
Write an
field, including tag, to the stream.
Definition at line 250 of file CodedOutputStream.java.
|
inline |
|
inline |
Write an
field, including tag, to the stream.
Definition at line 273 of file CodedOutputStream.java.
|
inline |
|
inline |
Write a
field, including tag, to the stream.
Definition at line 241 of file CodedOutputStream.java.
|
inline |
|
inline |
Write an
field, including tag, to the stream.
Definition at line 264 of file CodedOutputStream.java.
|
inline |
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Encode and write a tag.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field, including tag, to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
abstract |
Write a
field to the stream.
Reimplemented in com.google.protobuf.CodedOutputStream.OutputStreamEncoder, com.google.protobuf.CodedOutputStream.ByteOutputEncoder, com.google.protobuf.CodedOutputStream.UnsafeDirectNioEncoder, com.google.protobuf.CodedOutputStream.SafeDirectNioEncoder, and com.google.protobuf.CodedOutputStream.ArrayEncoder.
|
static |
The buffer size used in newInstance(OutputStream).
Definition at line 70 of file CodedOutputStream.java.
|
staticprivate |
Definition at line 61 of file CodedOutputStream.java.
|
static |
Definition at line 67 of file CodedOutputStream.java.
|
staticprivate |
Definition at line 60 of file CodedOutputStream.java.
|
private |
Definition at line 189 of file CodedOutputStream.java.