@Override public void writeUInt64(int fieldNumber, long value, boolean repeated) throws IOException { tail = sink.writeVarInt64( value, this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), this, tail)); /* * tail = writeTagAndRawVarInt64( makeTag(fieldNumber, WIRETYPE_VARINT), value, this, tail); */ }
@Override public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException { tail = sink.writeVarInt64( value, this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), this, tail)); /* * tail = writeTagAndRawVarInt64( makeTag(fieldNumber, WIRETYPE_VARINT), value, this, tail); */ }
@Override public void writeSInt64(int fieldNumber, long value, boolean repeated) throws IOException { tail = sink.writeVarInt64( encodeZigZag64(value), this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), this, tail)); /* * tail = writeTagAndRawVarInt64( makeTag(fieldNumber, WIRETYPE_VARINT), encodeZigZag64(value), this, tail); */ }
@Override public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException { if (value < 0) { tail = sink.writeVarInt64( value, this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), this, tail)); } else { tail = sink.writeVarInt32( value, this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), this, tail)); } /* * if(value < 0) { tail = writeTagAndRawVarInt64( makeTag(fieldNumber, WIRETYPE_VARINT), value, this, tail); } * else { tail = writeTagAndRawVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), value, this, tail); } */ }