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 enumThe order in which the fields are written by aWriter. -
Method Summary
Modifier and TypeMethodDescriptionIndicates the order in which the fields are written by thisWriter.voidwriteBool(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.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.groups fields are 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.groups fields are deprecated.voidwriteGroup(int fieldNumber, Object value, Schema schema) Deprecated.groups fields are deprecated.voidwriteGroupList(int fieldNumber, List<?> value) Deprecated.groups fields are deprecated.voidwriteGroupList(int fieldNumber, List<?> value, Schema schema) Deprecated.groups fields are deprecated.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.<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.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.groups fields are 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.
-
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 inMessageSetwire-format.- Parameters:
value- A message instance or an opaqueByteStringfor 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
-