Lines Matching refs:value
112 * @param {number} value
115 writeUnsignedVarint32_(value) {
116 checkTypeUnsignedInt32(value);
117 while (value > 0x7f) {
118 this.currentBuffer_.push((value & 0x7f) | 0x80);
119 value = value >>> 7;
121 this.currentBuffer_.push(value);
129 * Writes a boolean value field to the buffer as a varint.
130 * @param {boolean} value
133 writeBoolValue_(value) {
134 this.currentBuffer_.push(value ? 1 : 0);
138 * Writes a boolean value field to the buffer as a varint.
140 * @param {boolean} value
142 writeBool(fieldNumber, value) {
144 this.writeBoolValue_(value);
148 * Writes a bytes value field to the buffer as a length delimited field.
150 * @param {!ByteString} value
152 writeBytes(fieldNumber, value) {
154 const buffer = value.toArrayBuffer();
160 * Writes a double value field to the buffer without tag.
161 * @param {number} value
164 writeDoubleValue_(value) {
167 view.setFloat64(0, value, true);
172 * Writes a double value field to the buffer.
174 * @param {number} value
176 writeDouble(fieldNumber, value) {
178 this.writeDoubleValue_(value);
182 * Writes a fixed32 value field to the buffer without tag.
183 * @param {number} value
186 writeFixed32Value_(value) {
189 view.setUint32(0, value, true);
194 * Writes a fixed32 value field to the buffer.
196 * @param {number} value
198 writeFixed32(fieldNumber, value) {
200 this.writeFixed32Value_(value);
204 * Writes a float value field to the buffer without tag.
205 * @param {number} value
208 writeFloatValue_(value) {
211 view.setFloat32(0, value, true);
216 * Writes a float value field to the buffer.
218 * @param {number} value
220 writeFloat(fieldNumber, value) {
222 this.writeFloatValue_(value);
226 * Writes a int32 value field to the buffer as a varint without tag.
227 * @param {number} value
230 writeInt32Value_(value) {
231 if (value >= 0) {
232 this.writeVarint64_(0, value);
234 this.writeVarint64_(0xFFFFFFFF, value);
239 * Writes a int32 value field to the buffer as a varint.
241 * @param {number} value
243 writeInt32(fieldNumber, value) {
245 this.writeInt32Value_(value);
249 * Writes a int64 value field to the buffer as a varint.
251 * @param {!Int64} value
253 writeInt64(fieldNumber, value) {
255 this.writeVarint64_(value.getHighBits(), value.getLowBits());
259 * Writes a sfixed32 value field to the buffer.
260 * @param {number} value
263 writeSfixed32Value_(value) {
266 view.setInt32(0, value, true);
271 * Writes a sfixed32 value field to the buffer.
273 * @param {number} value
275 writeSfixed32(fieldNumber, value) {
277 this.writeSfixed32Value_(value);
281 * Writes a sfixed64 value field to the buffer without tag.
282 * @param {!Int64} value
285 writeSfixed64Value_(value) {
288 view.setInt32(0, value.getLowBits(), true);
289 view.setInt32(4, value.getHighBits(), true);
294 * Writes a sfixed64 value field to the buffer.
296 * @param {!Int64} value
298 writeSfixed64(fieldNumber, value) {
300 this.writeSfixed64Value_(value);
304 * Writes a sfixed64 value field to the buffer.
312 * Writes a sfixed64 value field to the buffer.
320 * Writes a uint32 value field to the buffer as a varint without tag.
321 * @param {number} value
324 writeUint32Value_(value) {
325 this.writeVarint64_(0, value);
329 * Writes a uint32 value field to the buffer as a varint.
331 * @param {number} value
333 writeUint32(fieldNumber, value) {
335 this.writeUint32Value_(value);
378 * Writes a sint32 value field to the buffer as a varint without tag.
379 * @param {number} value
382 writeSint32Value_(value) {
383 value = (value << 1) ^ (value >> 31);
384 this.writeVarint64_(0, value);
388 * Writes a sint32 value field to the buffer as a varint.
390 * @param {number} value
392 writeSint32(fieldNumber, value) {
394 this.writeSint32Value_(value);
398 * Writes a sint64 value field to the buffer as a varint without tag.
399 * @param {!Int64} value
402 writeSint64Value_(value) {
403 const highBits = value.getHighBits();
404 const lowBits = value.getLowBits();
413 * Writes a sint64 value field to the buffer as a varint.
415 * @param {!Int64} value
417 writeSint64(fieldNumber, value) {
419 this.writeSint64Value_(value);
423 * Writes a string value field to the buffer as a varint.
425 * @param {string} value
427 writeString(fieldNumber, value) {
429 const array = encoderFunction(value);
712 values.forEach(value => valueWriter(value));