Package com.google.protobuf
Interface Writer
- All Known Implementing Classes:
BinaryWriter
,BinaryWriter.SafeDirectWriter
,BinaryWriter.SafeHeapWriter
,BinaryWriter.UnsafeDirectWriter
,BinaryWriter.UnsafeHeapWriter
,CodedOutputStreamWriter
A writer that performs serialization of protobuf message fields.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The order in which the fields are written by aWriter
. -
Method Summary
Modifier and TypeMethodDescriptionIndicates the order in which the fields are written by thisWriter
.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
.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) Deprecated.groups fields are deprecated.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) Deprecated.groups fields are deprecated.void
writeGroup
(int fieldNumber, Object value, Schema schema) Deprecated.groups fields are deprecated.void
writeGroupList
(int fieldNumber, List<?> value) Deprecated.groups fields are deprecated.void
writeGroupList
(int fieldNumber, List<?> value, Schema schema) Deprecated.groups fields are deprecated.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
.<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
.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) Deprecated.groups fields are deprecated.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
.
-
Method Details
-
fieldOrder
Writer.FieldOrder fieldOrder()Indicates the order in which the fields are written by thisWriter
. -
writeSFixed32
Writes a field of typeFieldType.SFIXED32
.- Throws:
IOException
-
writeInt64
Writes a field of typeFieldType.INT64
.- Throws:
IOException
-
writeSFixed64
Writes a field of typeFieldType.SFIXED64
.- Throws:
IOException
-
writeFloat
Writes a field of typeFieldType.FLOAT
.- Throws:
IOException
-
writeDouble
Writes a field of typeFieldType.DOUBLE
.- Throws:
IOException
-
writeEnum
Writes a field of typeFieldType.ENUM
.- Throws:
IOException
-
writeUInt64
Writes a field of typeFieldType.UINT64
.- Throws:
IOException
-
writeInt32
Writes a field of typeFieldType.INT32
.- Throws:
IOException
-
writeFixed64
Writes a field of typeFieldType.FIXED64
.- Throws:
IOException
-
writeFixed32
Writes a field of typeFieldType.FIXED32
.- Throws:
IOException
-
writeBool
Writes a field of typeFieldType.BOOL
.- Throws:
IOException
-
writeString
Writes a field of typeFieldType.STRING
.- Throws:
IOException
-
writeBytes
Writes a field of typeFieldType.BYTES
.- Throws:
IOException
-
writeUInt32
Writes a field of typeFieldType.UINT32
.- Throws:
IOException
-
writeSInt32
Writes a field of typeFieldType.SINT32
.- Throws:
IOException
-
writeSInt64
Writes a field of typeFieldType.SINT64
.- Throws:
IOException
-
writeMessage
Writes a field of typeFieldType.MESSAGE
.- Throws:
IOException
-
writeMessage
Writes a field of typeFieldType.MESSAGE
.- Throws:
IOException
-
writeGroup
Deprecated.groups fields are deprecated.Writes a field of typeFieldType.GROUP
.- Throws:
IOException
-
writeGroup
Deprecated.groups fields are deprecated.Writes a field of typeFieldType.GROUP
.- Throws:
IOException
-
writeStartGroup
Deprecated.groups fields are deprecated.Writes a single start group tag.- Throws:
IOException
-
writeEndGroup
Deprecated.groups fields are deprecated.Writes a single end group tag.- Throws:
IOException
-
writeInt32List
Writes a list field of typeFieldType.INT32
.- Throws:
IOException
-
writeFixed32List
Writes a list field of typeFieldType.FIXED32
.- Throws:
IOException
-
writeInt64List
Writes a list field of typeFieldType.INT64
.- Throws:
IOException
-
writeUInt64List
Writes a list field of typeFieldType.UINT64
.- Throws:
IOException
-
writeFixed64List
Writes a list field of typeFieldType.FIXED64
.- Throws:
IOException
-
writeFloatList
Writes a list field of typeFieldType.FLOAT
.- Throws:
IOException
-
writeDoubleList
Writes a list field of typeFieldType.DOUBLE
.- Throws:
IOException
-
writeEnumList
Writes a list field of typeFieldType.ENUM
.- Throws:
IOException
-
writeBoolList
Writes a list field of typeFieldType.BOOL
.- Throws:
IOException
-
writeStringList
Writes a list field of typeFieldType.STRING
.- Throws:
IOException
-
writeBytesList
Writes a list field of typeFieldType.BYTES
.- Throws:
IOException
-
writeUInt32List
Writes a list field of typeFieldType.UINT32
.- Throws:
IOException
-
writeSFixed32List
Writes a list field of typeFieldType.SFIXED32
.- Throws:
IOException
-
writeSFixed64List
Writes a list field of typeFieldType.SFIXED64
.- Throws:
IOException
-
writeSInt32List
Writes a list field of typeFieldType.SINT32
.- Throws:
IOException
-
writeSInt64List
Writes a list field of typeFieldType.SINT64
.- Throws:
IOException
-
writeMessageList
Writes a list field of typeFieldType.MESSAGE
.- Throws:
IOException
-
writeMessageList
Writes a list field of typeFieldType.MESSAGE
.- Throws:
IOException
-
writeGroupList
Deprecated.groups fields are deprecated.Writes a list field of typeFieldType.GROUP
.- Throws:
IOException
-
writeGroupList
Deprecated.groups fields are deprecated.Writes a list field of typeFieldType.GROUP
.- Throws:
IOException
-
writeMessageSetItem
Writes a message field inMessageSet
wire-format.- Parameters:
value
- A message instance or an opaqueByteString
for an unknown field.- Throws:
IOException
-
writeMap
<K,V> void writeMap(int fieldNumber, MapEntryLite.Metadata<K, V> metadata, Map<K, throws IOExceptionV> map) Writes a map field.- Throws:
IOException
-