else
return in.readRawVarint64();
}
private static void serializeFullResMetric(Object o, byte[] buf) throws IOException {
CodedOutputStream protobufOut = CodedOutputStream.newInstance(buf);
byte type = typeOf(o);
fullResSize.update(sizeOf(o, type));
protobufOut.writeRawByte(Constants.VERSION_1_FULL_RES);
switch (type) {
case Constants.B_I32:
protobufOut.writeRawByte(type);
protobufOut.writeRawVarint32((Integer) o);
break;
case Constants.B_I64:
protobufOut.writeRawByte(type);
protobufOut.writeRawVarint64((Long) o);
break;
case Constants.B_DOUBLE:
protobufOut.writeRawByte(type);
protobufOut.writeDoubleNoTag((Double) o);
break;
case Type.B_FLOAT_AS_DOUBLE:
protobufOut.writeRawByte(Constants.B_DOUBLE);
protobufOut.writeDoubleNoTag(((Float) o).doubleValue());
break;
default:
throw new SerializationException(String.format("Cannot serialize %s", o.getClass().getName()));
}
}