use of io.protostuff.ByteBufferInput in project java-chassis by ServiceComb.
the class WrapSchema method readObject.
@SuppressWarnings("unchecked")
default default <T> T readObject(Buffer buffer) throws Exception {
if (buffer == null || buffer.length() == 0) {
// 空串时,protobuf至少为编码为1字节
return (T) readFromEmpty();
}
ByteBuffer nioBuffer = buffer.getByteBuf().nioBuffer();
Input input = new ByteBufferInput(nioBuffer, false);
return (T) readObject(input);
}
Aggregations