Package com.google.protobuf
Class CodedOutputStreamWriter
java.lang.Object
com.google.protobuf.CodedOutputStreamWriter
- All Implemented Interfaces:
Writer
An adapter between the
Writer
interface and CodedOutputStream
.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.protobuf.Writer
Writer.FieldOrder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIndicates the order in which the fields are written by thisWriter
.static CodedOutputStreamWriter
forCodedOutput
(CodedOutputStream output) int
void
writeBool
(int fieldNumber, boolean value) Writes a field of typeFieldType.BOOL
.void
writeBoolList
(int fieldNumber, List<Boolean> value, boolean packed) Writes a list field of typeFieldType.BOOL
.void
writeBytes
(int fieldNumber, ByteString value) Writes a field of typeFieldType.BYTES
.void
writeBytesList
(int fieldNumber, List<ByteString> value) Writes a list field of typeFieldType.BYTES
.private <V> void
writeDeterministicBooleanMapEntry
(int fieldNumber, boolean key, V value, MapEntryLite.Metadata<Boolean, V> metadata) private <V> void
writeDeterministicIntegerMap
(int fieldNumber, MapEntryLite.Metadata<Integer, V> metadata, Map<Integer, V> map) private <V> void
writeDeterministicLongMap
(int fieldNumber, MapEntryLite.Metadata<Long, V> metadata, Map<Long, V> map) private <K,
V> void writeDeterministicMap
(int fieldNumber, MapEntryLite.Metadata<K, V> metadata, Map<K, V> map) private <V> void
writeDeterministicStringMap
(int fieldNumber, MapEntryLite.Metadata<String, V> metadata, Map<String, V> map) void
writeDouble
(int fieldNumber, double value) Writes a field of typeFieldType.DOUBLE
.void
writeDoubleList
(int fieldNumber, List<Double> value, boolean packed) Writes a list field of typeFieldType.DOUBLE
.void
writeEndGroup
(int fieldNumber) Writes a single end group tag.void
writeEnum
(int fieldNumber, int value) Writes a field of typeFieldType.ENUM
.void
writeEnumList
(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.ENUM
.void
writeFixed32
(int fieldNumber, int value) Writes a field of typeFieldType.FIXED32
.void
writeFixed32List
(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.FIXED32
.void
writeFixed64
(int fieldNumber, long value) Writes a field of typeFieldType.FIXED64
.void
writeFixed64List
(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.FIXED64
.void
writeFloat
(int fieldNumber, float value) Writes a field of typeFieldType.FLOAT
.void
writeFloatList
(int fieldNumber, List<Float> value, boolean packed) Writes a list field of typeFieldType.FLOAT
.void
writeGroup
(int fieldNumber, Object value) Writes a field of typeFieldType.GROUP
.void
writeGroup
(int fieldNumber, Object value, Schema schema) Writes a field of typeFieldType.GROUP
.void
writeGroupList
(int fieldNumber, List<?> value) Writes a list field of typeFieldType.GROUP
.void
writeGroupList
(int fieldNumber, List<?> value, Schema schema) Writes a list field of typeFieldType.GROUP
.void
writeInt32
(int fieldNumber, int value) Writes a field of typeFieldType.INT32
.void
writeInt32List
(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.INT32
.void
writeInt64
(int fieldNumber, long value) Writes a field of typeFieldType.INT64
.void
writeInt64List
(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.INT64
.private void
writeLazyString
(int fieldNumber, Object value) <K,
V> void writeMap
(int fieldNumber, MapEntryLite.Metadata<K, V> metadata, Map<K, V> map) Writes a map field.void
writeMessage
(int fieldNumber, Object value) Writes a field of typeFieldType.MESSAGE
.void
writeMessage
(int fieldNumber, Object value, Schema schema) Writes a field of typeFieldType.MESSAGE
.void
writeMessageList
(int fieldNumber, List<?> value) Writes a list field of typeFieldType.MESSAGE
.void
writeMessageList
(int fieldNumber, List<?> value, Schema schema) Writes a list field of typeFieldType.MESSAGE
.final void
writeMessageSetItem
(int fieldNumber, Object value) Writes a message field inMessageSet
wire-format.void
writeSFixed32
(int fieldNumber, int value) Writes a field of typeFieldType.SFIXED32
.void
writeSFixed32List
(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.SFIXED32
.void
writeSFixed64
(int fieldNumber, long value) Writes a field of typeFieldType.SFIXED64
.void
writeSFixed64List
(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.SFIXED64
.void
writeSInt32
(int fieldNumber, int value) Writes a field of typeFieldType.SINT32
.void
writeSInt32List
(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.SINT32
.void
writeSInt64
(int fieldNumber, long value) Writes a field of typeFieldType.SINT64
.void
writeSInt64List
(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.SINT64
.void
writeStartGroup
(int fieldNumber) Writes a single start group tag.void
writeString
(int fieldNumber, String value) Writes a field of typeFieldType.STRING
.void
writeStringList
(int fieldNumber, List<String> value) Writes a list field of typeFieldType.STRING
.void
writeUInt32
(int fieldNumber, int value) Writes a field of typeFieldType.UINT32
.void
writeUInt32List
(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.UINT32
.void
writeUInt64
(int fieldNumber, long value) Writes a field of typeFieldType.UINT64
.void
writeUInt64List
(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.UINT64
.
-
Field Details
-
output
-
-
Constructor Details
-
CodedOutputStreamWriter
-
-
Method Details
-
forCodedOutput
-
fieldOrder
Description copied from interface:Writer
Indicates the order in which the fields are written by thisWriter
.- Specified by:
fieldOrder
in interfaceWriter
-
getTotalBytesWritten
public int getTotalBytesWritten() -
writeSFixed32
Description copied from interface:Writer
Writes a field of typeFieldType.SFIXED32
.- Specified by:
writeSFixed32
in interfaceWriter
- Throws:
IOException
-
writeInt64
Description copied from interface:Writer
Writes a field of typeFieldType.INT64
.- Specified by:
writeInt64
in interfaceWriter
- Throws:
IOException
-
writeSFixed64
Description copied from interface:Writer
Writes a field of typeFieldType.SFIXED64
.- Specified by:
writeSFixed64
in interfaceWriter
- Throws:
IOException
-
writeFloat
Description copied from interface:Writer
Writes a field of typeFieldType.FLOAT
.- Specified by:
writeFloat
in interfaceWriter
- Throws:
IOException
-
writeDouble
Description copied from interface:Writer
Writes a field of typeFieldType.DOUBLE
.- Specified by:
writeDouble
in interfaceWriter
- Throws:
IOException
-
writeEnum
Description copied from interface:Writer
Writes a field of typeFieldType.ENUM
.- Specified by:
writeEnum
in interfaceWriter
- Throws:
IOException
-
writeUInt64
Description copied from interface:Writer
Writes a field of typeFieldType.UINT64
.- Specified by:
writeUInt64
in interfaceWriter
- Throws:
IOException
-
writeInt32
Description copied from interface:Writer
Writes a field of typeFieldType.INT32
.- Specified by:
writeInt32
in interfaceWriter
- Throws:
IOException
-
writeFixed64
Description copied from interface:Writer
Writes a field of typeFieldType.FIXED64
.- Specified by:
writeFixed64
in interfaceWriter
- Throws:
IOException
-
writeFixed32
Description copied from interface:Writer
Writes a field of typeFieldType.FIXED32
.- Specified by:
writeFixed32
in interfaceWriter
- Throws:
IOException
-
writeBool
Description copied from interface:Writer
Writes a field of typeFieldType.BOOL
.- Specified by:
writeBool
in interfaceWriter
- Throws:
IOException
-
writeString
Description copied from interface:Writer
Writes a field of typeFieldType.STRING
.- Specified by:
writeString
in interfaceWriter
- Throws:
IOException
-
writeBytes
Description copied from interface:Writer
Writes a field of typeFieldType.BYTES
.- Specified by:
writeBytes
in interfaceWriter
- Throws:
IOException
-
writeUInt32
Description copied from interface:Writer
Writes a field of typeFieldType.UINT32
.- Specified by:
writeUInt32
in interfaceWriter
- Throws:
IOException
-
writeSInt32
Description copied from interface:Writer
Writes a field of typeFieldType.SINT32
.- Specified by:
writeSInt32
in interfaceWriter
- Throws:
IOException
-
writeSInt64
Description copied from interface:Writer
Writes a field of typeFieldType.SINT64
.- Specified by:
writeSInt64
in interfaceWriter
- Throws:
IOException
-
writeMessage
Description copied from interface:Writer
Writes a field of typeFieldType.MESSAGE
.- Specified by:
writeMessage
in interfaceWriter
- Throws:
IOException
-
writeMessage
Description copied from interface:Writer
Writes a field of typeFieldType.MESSAGE
.- Specified by:
writeMessage
in interfaceWriter
- Throws:
IOException
-
writeGroup
Description copied from interface:Writer
Writes a field of typeFieldType.GROUP
.- Specified by:
writeGroup
in interfaceWriter
- Throws:
IOException
-
writeGroup
Description copied from interface:Writer
Writes a field of typeFieldType.GROUP
.- Specified by:
writeGroup
in interfaceWriter
- Throws:
IOException
-
writeStartGroup
Description copied from interface:Writer
Writes a single start group tag.- Specified by:
writeStartGroup
in interfaceWriter
- Throws:
IOException
-
writeEndGroup
Description copied from interface:Writer
Writes a single end group tag.- Specified by:
writeEndGroup
in interfaceWriter
- Throws:
IOException
-
writeMessageSetItem
Description copied from interface:Writer
Writes a message field inMessageSet
wire-format.- Specified by:
writeMessageSetItem
in interfaceWriter
- Parameters:
value
- A message instance or an opaqueByteString
for an unknown field.- Throws:
IOException
-
writeInt32List
Description copied from interface:Writer
Writes a list field of typeFieldType.INT32
.- Specified by:
writeInt32List
in interfaceWriter
- Throws:
IOException
-
writeFixed32List
public void writeFixed32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:Writer
Writes a list field of typeFieldType.FIXED32
.- Specified by:
writeFixed32List
in interfaceWriter
- Throws:
IOException
-
writeInt64List
Description copied from interface:Writer
Writes a list field of typeFieldType.INT64
.- Specified by:
writeInt64List
in interfaceWriter
- Throws:
IOException
-
writeUInt64List
Description copied from interface:Writer
Writes a list field of typeFieldType.UINT64
.- Specified by:
writeUInt64List
in interfaceWriter
- Throws:
IOException
-
writeFixed64List
Description copied from interface:Writer
Writes a list field of typeFieldType.FIXED64
.- Specified by:
writeFixed64List
in interfaceWriter
- Throws:
IOException
-
writeFloatList
Description copied from interface:Writer
Writes a list field of typeFieldType.FLOAT
.- Specified by:
writeFloatList
in interfaceWriter
- Throws:
IOException
-
writeDoubleList
Description copied from interface:Writer
Writes a list field of typeFieldType.DOUBLE
.- Specified by:
writeDoubleList
in interfaceWriter
- Throws:
IOException
-
writeEnumList
Description copied from interface:Writer
Writes a list field of typeFieldType.ENUM
.- Specified by:
writeEnumList
in interfaceWriter
- Throws:
IOException
-
writeBoolList
Description copied from interface:Writer
Writes a list field of typeFieldType.BOOL
.- Specified by:
writeBoolList
in interfaceWriter
- Throws:
IOException
-
writeStringList
Description copied from interface:Writer
Writes a list field of typeFieldType.STRING
.- Specified by:
writeStringList
in interfaceWriter
- Throws:
IOException
-
writeLazyString
- Throws:
IOException
-
writeBytesList
Description copied from interface:Writer
Writes a list field of typeFieldType.BYTES
.- Specified by:
writeBytesList
in interfaceWriter
- Throws:
IOException
-
writeUInt32List
public void writeUInt32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:Writer
Writes a list field of typeFieldType.UINT32
.- Specified by:
writeUInt32List
in interfaceWriter
- Throws:
IOException
-
writeSFixed32List
public void writeSFixed32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:Writer
Writes a list field of typeFieldType.SFIXED32
.- Specified by:
writeSFixed32List
in interfaceWriter
- Throws:
IOException
-
writeSFixed64List
Description copied from interface:Writer
Writes a list field of typeFieldType.SFIXED64
.- Specified by:
writeSFixed64List
in interfaceWriter
- Throws:
IOException
-
writeSInt32List
public void writeSInt32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:Writer
Writes a list field of typeFieldType.SINT32
.- Specified by:
writeSInt32List
in interfaceWriter
- Throws:
IOException
-
writeSInt64List
Description copied from interface:Writer
Writes a list field of typeFieldType.SINT64
.- Specified by:
writeSInt64List
in interfaceWriter
- Throws:
IOException
-
writeMessageList
Description copied from interface:Writer
Writes a list field of typeFieldType.MESSAGE
.- Specified by:
writeMessageList
in interfaceWriter
- Throws:
IOException
-
writeMessageList
Description copied from interface:Writer
Writes a list field of typeFieldType.MESSAGE
.- Specified by:
writeMessageList
in interfaceWriter
- Throws:
IOException
-
writeGroupList
Description copied from interface:Writer
Writes a list field of typeFieldType.GROUP
.- Specified by:
writeGroupList
in interfaceWriter
- Throws:
IOException
-
writeGroupList
Description copied from interface:Writer
Writes a list field of typeFieldType.GROUP
.- Specified by:
writeGroupList
in interfaceWriter
- Throws:
IOException
-
writeMap
public <K,V> void writeMap(int fieldNumber, MapEntryLite.Metadata<K, V> metadata, Map<K, throws IOExceptionV> map) Description copied from interface:Writer
Writes a map field.- Specified by:
writeMap
in interfaceWriter
- Throws:
IOException
-
writeDeterministicMap
private <K,V> void writeDeterministicMap(int fieldNumber, MapEntryLite.Metadata<K, V> metadata, Map<K, throws IOExceptionV> map) - Throws:
IOException
-
writeDeterministicBooleanMapEntry
private <V> void writeDeterministicBooleanMapEntry(int fieldNumber, boolean key, V value, MapEntryLite.Metadata<Boolean, V> metadata) throws IOException- Throws:
IOException
-
writeDeterministicIntegerMap
private <V> void writeDeterministicIntegerMap(int fieldNumber, MapEntryLite.Metadata<Integer, V> metadata, Map<Integer, throws IOExceptionV> map) - Throws:
IOException
-
writeDeterministicLongMap
private <V> void writeDeterministicLongMap(int fieldNumber, MapEntryLite.Metadata<Long, V> metadata, Map<Long, throws IOExceptionV> map) - Throws:
IOException
-
writeDeterministicStringMap
private <V> void writeDeterministicStringMap(int fieldNumber, MapEntryLite.Metadata<String, V> metadata, Map<String, throws IOExceptionV> map) - Throws:
IOException
-