Package com.google.protobuf
Class CodedOutputStreamWriter
java.lang.Object
com.google.protobuf.CodedOutputStreamWriter
- All Implemented Interfaces:
Writer
@CheckReturnValue
@ExperimentalApi
final class CodedOutputStreamWriter
extends Object
implements 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 CodedOutputStreamWriterforCodedOutput(CodedOutputStream output) intvoidwriteBool(int fieldNumber, boolean value) Writes a field of typeFieldType.BOOL.voidwriteBoolList(int fieldNumber, List<Boolean> value, boolean packed) Writes a list field of typeFieldType.BOOL.voidwriteBytes(int fieldNumber, ByteString value) Writes a field of typeFieldType.BYTES.voidwriteBytesList(int fieldNumber, List<ByteString> value) Writes a list field of typeFieldType.BYTES.private <V> voidwriteDeterministicBooleanMapEntry(int fieldNumber, boolean key, V value, MapEntryLite.Metadata<Boolean, V> metadata) private <V> voidwriteDeterministicIntegerMap(int fieldNumber, MapEntryLite.Metadata<Integer, V> metadata, Map<Integer, V> map) private <V> voidwriteDeterministicLongMap(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> voidwriteDeterministicStringMap(int fieldNumber, MapEntryLite.Metadata<String, V> metadata, Map<String, V> map) voidwriteDouble(int fieldNumber, double value) Writes a field of typeFieldType.DOUBLE.voidwriteDoubleList(int fieldNumber, List<Double> value, boolean packed) Writes a list field of typeFieldType.DOUBLE.voidwriteEndGroup(int fieldNumber) Deprecated.voidwriteEnum(int fieldNumber, int value) Writes a field of typeFieldType.ENUM.voidwriteEnumList(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.ENUM.voidwriteFixed32(int fieldNumber, int value) Writes a field of typeFieldType.FIXED32.voidwriteFixed32List(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.FIXED32.voidwriteFixed64(int fieldNumber, long value) Writes a field of typeFieldType.FIXED64.voidwriteFixed64List(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.FIXED64.voidwriteFloat(int fieldNumber, float value) Writes a field of typeFieldType.FLOAT.voidwriteFloatList(int fieldNumber, List<Float> value, boolean packed) Writes a list field of typeFieldType.FLOAT.voidwriteGroup(int fieldNumber, Object value) Deprecated.voidwriteGroup(int fieldNumber, Object value, Schema schema) Writes a field of typeFieldType.GROUP.voidwriteGroupList(int fieldNumber, List<?> value) Deprecated.voidwriteGroupList(int fieldNumber, List<?> value, Schema schema) Writes a list field of typeFieldType.GROUP.voidwriteInt32(int fieldNumber, int value) Writes a field of typeFieldType.INT32.voidwriteInt32List(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.INT32.voidwriteInt64(int fieldNumber, long value) Writes a field of typeFieldType.INT64.voidwriteInt64List(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.INT64.private voidwriteLazyString(int fieldNumber, Object value) <K,V> void writeMap(int fieldNumber, MapEntryLite.Metadata<K, V> metadata, Map<K, V> map) Writes a map field.voidwriteMessage(int fieldNumber, Object value) Writes a field of typeFieldType.MESSAGE.voidwriteMessage(int fieldNumber, Object value, Schema schema) Writes a field of typeFieldType.MESSAGE.voidwriteMessageList(int fieldNumber, List<?> value) Writes a list field of typeFieldType.MESSAGE.voidwriteMessageList(int fieldNumber, List<?> value, Schema schema) Writes a list field of typeFieldType.MESSAGE.final voidwriteMessageSetItem(int fieldNumber, Object value) Writes a message field inMessageSetwire-format.voidwriteSFixed32(int fieldNumber, int value) Writes a field of typeFieldType.SFIXED32.voidwriteSFixed32List(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.SFIXED32.voidwriteSFixed64(int fieldNumber, long value) Writes a field of typeFieldType.SFIXED64.voidwriteSFixed64List(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.SFIXED64.voidwriteSInt32(int fieldNumber, int value) Writes a field of typeFieldType.SINT32.voidwriteSInt32List(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.SINT32.voidwriteSInt64(int fieldNumber, long value) Writes a field of typeFieldType.SINT64.voidwriteSInt64List(int fieldNumber, List<Long> value, boolean packed) Writes a list field of typeFieldType.SINT64.voidwriteStartGroup(int fieldNumber) Deprecated.voidwriteString(int fieldNumber, String value) Writes a field of typeFieldType.STRING.voidwriteStringList(int fieldNumber, List<String> value) Writes a list field of typeFieldType.STRING.voidwriteUInt32(int fieldNumber, int value) Writes a field of typeFieldType.UINT32.voidwriteUInt32List(int fieldNumber, List<Integer> value, boolean packed) Writes a list field of typeFieldType.UINT32.voidwriteUInt64(int fieldNumber, long value) Writes a field of typeFieldType.UINT64.voidwriteUInt64List(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:WriterIndicates the order in which the fields are written by thisWriter.- Specified by:
fieldOrderin interfaceWriter
-
getTotalBytesWritten
public int getTotalBytesWritten() -
writeSFixed32
Description copied from interface:WriterWrites a field of typeFieldType.SFIXED32.- Specified by:
writeSFixed32in interfaceWriter- Throws:
IOException
-
writeInt64
Description copied from interface:WriterWrites a field of typeFieldType.INT64.- Specified by:
writeInt64in interfaceWriter- Throws:
IOException
-
writeSFixed64
Description copied from interface:WriterWrites a field of typeFieldType.SFIXED64.- Specified by:
writeSFixed64in interfaceWriter- Throws:
IOException
-
writeFloat
Description copied from interface:WriterWrites a field of typeFieldType.FLOAT.- Specified by:
writeFloatin interfaceWriter- Throws:
IOException
-
writeDouble
Description copied from interface:WriterWrites a field of typeFieldType.DOUBLE.- Specified by:
writeDoublein interfaceWriter- Throws:
IOException
-
writeEnum
Description copied from interface:WriterWrites a field of typeFieldType.ENUM.- Specified by:
writeEnumin interfaceWriter- Throws:
IOException
-
writeUInt64
Description copied from interface:WriterWrites a field of typeFieldType.UINT64.- Specified by:
writeUInt64in interfaceWriter- Throws:
IOException
-
writeInt32
Description copied from interface:WriterWrites a field of typeFieldType.INT32.- Specified by:
writeInt32in interfaceWriter- Throws:
IOException
-
writeFixed64
Description copied from interface:WriterWrites a field of typeFieldType.FIXED64.- Specified by:
writeFixed64in interfaceWriter- Throws:
IOException
-
writeFixed32
Description copied from interface:WriterWrites a field of typeFieldType.FIXED32.- Specified by:
writeFixed32in interfaceWriter- Throws:
IOException
-
writeBool
Description copied from interface:WriterWrites a field of typeFieldType.BOOL.- Specified by:
writeBoolin interfaceWriter- Throws:
IOException
-
writeString
Description copied from interface:WriterWrites a field of typeFieldType.STRING.- Specified by:
writeStringin interfaceWriter- Throws:
IOException
-
writeBytes
Description copied from interface:WriterWrites a field of typeFieldType.BYTES.- Specified by:
writeBytesin interfaceWriter- Throws:
IOException
-
writeUInt32
Description copied from interface:WriterWrites a field of typeFieldType.UINT32.- Specified by:
writeUInt32in interfaceWriter- Throws:
IOException
-
writeSInt32
Description copied from interface:WriterWrites a field of typeFieldType.SINT32.- Specified by:
writeSInt32in interfaceWriter- Throws:
IOException
-
writeSInt64
Description copied from interface:WriterWrites a field of typeFieldType.SINT64.- Specified by:
writeSInt64in interfaceWriter- Throws:
IOException
-
writeMessage
Description copied from interface:WriterWrites a field of typeFieldType.MESSAGE.- Specified by:
writeMessagein interfaceWriter- Throws:
IOException
-
writeMessage
Description copied from interface:WriterWrites a field of typeFieldType.MESSAGE.- Specified by:
writeMessagein interfaceWriter- Throws:
IOException
-
writeGroup
Deprecated.Description copied from interface:WriterWrites a field of typeFieldType.GROUP.- Specified by:
writeGroupin interfaceWriter- Throws:
IOException
-
writeGroup
Description copied from interface:WriterWrites a field of typeFieldType.GROUP.- Specified by:
writeGroupin interfaceWriter- Throws:
IOException
-
writeStartGroup
Deprecated.Description copied from interface:WriterWrites a single start group tag.- Specified by:
writeStartGroupin interfaceWriter- Throws:
IOException
-
writeEndGroup
Deprecated.Description copied from interface:WriterWrites a single end group tag.- Specified by:
writeEndGroupin interfaceWriter- Throws:
IOException
-
writeMessageSetItem
Description copied from interface:WriterWrites a message field inMessageSetwire-format.- Specified by:
writeMessageSetItemin interfaceWritervalue- A message instance or an opaqueByteStringfor an unknown field.- Throws:
IOException
-
writeInt32List
Description copied from interface:WriterWrites a list field of typeFieldType.INT32.- Specified by:
writeInt32Listin interfaceWriter- Throws:
IOException
-
writeFixed32List
public void writeFixed32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:WriterWrites a list field of typeFieldType.FIXED32.- Specified by:
writeFixed32Listin interfaceWriter- Throws:
IOException
-
writeInt64List
Description copied from interface:WriterWrites a list field of typeFieldType.INT64.- Specified by:
writeInt64Listin interfaceWriter- Throws:
IOException
-
writeUInt64List
Description copied from interface:WriterWrites a list field of typeFieldType.UINT64.- Specified by:
writeUInt64Listin interfaceWriter- Throws:
IOException
-
writeFixed64List
Description copied from interface:WriterWrites a list field of typeFieldType.FIXED64.- Specified by:
writeFixed64Listin interfaceWriter- Throws:
IOException
-
writeFloatList
Description copied from interface:WriterWrites a list field of typeFieldType.FLOAT.- Specified by:
writeFloatListin interfaceWriter- Throws:
IOException
-
writeDoubleList
Description copied from interface:WriterWrites a list field of typeFieldType.DOUBLE.- Specified by:
writeDoubleListin interfaceWriter- Throws:
IOException
-
writeEnumList
Description copied from interface:WriterWrites a list field of typeFieldType.ENUM.- Specified by:
writeEnumListin interfaceWriter- Throws:
IOException
-
writeBoolList
Description copied from interface:WriterWrites a list field of typeFieldType.BOOL.- Specified by:
writeBoolListin interfaceWriter- Throws:
IOException
-
writeStringList
Description copied from interface:WriterWrites a list field of typeFieldType.STRING.- Specified by:
writeStringListin interfaceWriter- Throws:
IOException
-
writeLazyString
- Throws:
IOException
-
writeBytesList
Description copied from interface:WriterWrites a list field of typeFieldType.BYTES.- Specified by:
writeBytesListin interfaceWriter- Throws:
IOException
-
writeUInt32List
public void writeUInt32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:WriterWrites a list field of typeFieldType.UINT32.- Specified by:
writeUInt32Listin interfaceWriter- Throws:
IOException
-
writeSFixed32List
public void writeSFixed32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:WriterWrites a list field of typeFieldType.SFIXED32.- Specified by:
writeSFixed32Listin interfaceWriter- Throws:
IOException
-
writeSFixed64List
Description copied from interface:WriterWrites a list field of typeFieldType.SFIXED64.- Specified by:
writeSFixed64Listin interfaceWriter- Throws:
IOException
-
writeSInt32List
public void writeSInt32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException Description copied from interface:WriterWrites a list field of typeFieldType.SINT32.- Specified by:
writeSInt32Listin interfaceWriter- Throws:
IOException
-
writeSInt64List
Description copied from interface:WriterWrites a list field of typeFieldType.SINT64.- Specified by:
writeSInt64Listin interfaceWriter- Throws:
IOException
-
writeMessageList
Description copied from interface:WriterWrites a list field of typeFieldType.MESSAGE.- Specified by:
writeMessageListin interfaceWriter- Throws:
IOException
-
writeMessageList
Description copied from interface:WriterWrites a list field of typeFieldType.MESSAGE.- Specified by:
writeMessageListin interfaceWriter- Throws:
IOException
-
writeGroupList
Deprecated.Description copied from interface:WriterWrites a list field of typeFieldType.GROUP.- Specified by:
writeGroupListin interfaceWriter- Throws:
IOException
-
writeGroupList
Description copied from interface:WriterWrites a list field of typeFieldType.GROUP.- Specified by:
writeGroupListin 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:WriterWrites a map field.- Specified by:
writeMapin 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
-