Writer.java
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 package com.google.protobuf;
32 
33 import java.io.IOException;
34 import java.util.List;
35 import java.util.Map;
36 
38 @ExperimentalApi
39 interface Writer {
40 
42  enum FieldOrder {
45 
47  DESCENDING
48  }
49 
51  FieldOrder fieldOrder();
52 
54  void writeSFixed32(int fieldNumber, int value) throws IOException;
55 
57  void writeInt64(int fieldNumber, long value) throws IOException;
58 
60  void writeSFixed64(int fieldNumber, long value) throws IOException;
61 
63  void writeFloat(int fieldNumber, float value) throws IOException;
64 
66  void writeDouble(int fieldNumber, double value) throws IOException;
67 
69  void writeEnum(int fieldNumber, int value) throws IOException;
70 
72  void writeUInt64(int fieldNumber, long value) throws IOException;
73 
75  void writeInt32(int fieldNumber, int value) throws IOException;
76 
78  void writeFixed64(int fieldNumber, long value) throws IOException;
79 
81  void writeFixed32(int fieldNumber, int value) throws IOException;
82 
84  void writeBool(int fieldNumber, boolean value) throws IOException;
85 
87  void writeString(int fieldNumber, String value) throws IOException;
88 
90  void writeBytes(int fieldNumber, ByteString value) throws IOException;
91 
93  void writeUInt32(int fieldNumber, int value) throws IOException;
94 
96  void writeSInt32(int fieldNumber, int value) throws IOException;
97 
99  void writeSInt64(int fieldNumber, long value) throws IOException;
100 
102  void writeMessage(int fieldNumber, Object value) throws IOException;
103 
105  void writeMessage(int fieldNumber, Object value, Schema schema) throws IOException;
106 
112  @Deprecated
113  void writeGroup(int fieldNumber, Object value) throws IOException;
114 
120  @Deprecated
121  void writeGroup(int fieldNumber, Object value, Schema schema) throws IOException;
122 
128  @Deprecated
129  void writeStartGroup(int fieldNumber) throws IOException;
130 
136  @Deprecated
137  void writeEndGroup(int fieldNumber) throws IOException;
138 
140  void writeInt32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException;
141 
143  void writeFixed32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException;
144 
146  void writeInt64List(int fieldNumber, List<Long> value, boolean packed) throws IOException;
147 
149  void writeUInt64List(int fieldNumber, List<Long> value, boolean packed) throws IOException;
150 
152  void writeFixed64List(int fieldNumber, List<Long> value, boolean packed) throws IOException;
153 
155  void writeFloatList(int fieldNumber, List<Float> value, boolean packed) throws IOException;
156 
158  void writeDoubleList(int fieldNumber, List<Double> value, boolean packed) throws IOException;
159 
161  void writeEnumList(int fieldNumber, List<Integer> value, boolean packed) throws IOException;
162 
164  void writeBoolList(int fieldNumber, List<Boolean> value, boolean packed) throws IOException;
165 
167  void writeStringList(int fieldNumber, List<String> value) throws IOException;
168 
170  void writeBytesList(int fieldNumber, List<ByteString> value) throws IOException;
171 
173  void writeUInt32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException;
174 
176  void writeSFixed32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException;
177 
179  void writeSFixed64List(int fieldNumber, List<Long> value, boolean packed) throws IOException;
180 
182  void writeSInt32List(int fieldNumber, List<Integer> value, boolean packed) throws IOException;
183 
185  void writeSInt64List(int fieldNumber, List<Long> value, boolean packed) throws IOException;
186 
188  void writeMessageList(int fieldNumber, List<?> value) throws IOException;
189 
191  void writeMessageList(int fieldNumber, List<?> value, Schema schema) throws IOException;
192 
198  @Deprecated
199  void writeGroupList(int fieldNumber, List<?> value) throws IOException;
200 
206  @Deprecated
207  void writeGroupList(int fieldNumber, List<?> value, Schema schema) throws IOException;
208 
214  void writeMessageSetItem(int fieldNumber, Object value) throws IOException;
215 
217  <K, V> void writeMap(int fieldNumber, MapEntryLite.Metadata<K, V> metadata, Map<K, V> map)
218  throws IOException;
219 }
com.google.protobuf.Writer.FieldOrder
Definition: Writer.java:42
K
#define K(t)
Definition: sha1.c:43
Json::writeString
std::string JSON_API writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience. A StreamWriter will be created from the...
Definition: jsoncpp.cpp:5169
com.google.protobuf.MapEntryLite.Metadata
Definition: MapEntryLite.java:47
benchmarks.util.result_uploader.metadata
def metadata
Definition: result_uploader.py:97
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:473
com.google.protobuf.Writer.FieldOrder.ASCENDING
ASCENDING
Definition: Writer.java:44
java
com.google.protobuf.MapEntryLite
Definition: MapEntryLite.java:45
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
com.google.protobuf.ByteString
Definition: ByteString.java:67


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:02