in 3-extensions/serialization/dubbo-samples-protobuf-json/protobuf-json-serialization-implement/src/main/java/org/apache/dubbo/sample/protobuf/serialization/ProtobufObjectInput.java [71:86]
public <T> T readObject(Class<T> cls) {
if (cls == null || cls == Object.class) {
return (T) readObject();
}
try {
String className = readUTF();
if (protobufUtil.canSerializeWithProtobuf(protobufUtil.loadClass(className))) {
byte[] data = readBytes();
return deserializeWithProtobuf(data, cls);
}
return delegate.readObject(cls);
} catch (Throwable ex) {
throw new ProtobufSerializationException("Unable to deserializeWithProtobuf object for " + cls.getName(), ex);
}
}