@Test public void testGetInputSerializedSize() throws Exception { Method method = EchoService.class.getMethod("echo", EchoRequest.class); JprotobufRpcMethodInfo rpcMethodInfo = new JprotobufRpcMethodInfo(method); EchoRequest request = new EchoRequest(); request.setMessage("hello"); Assert.assertTrue(rpcMethodInfo.getInputSerializedSize(request) == Echo.EchoRequest.newBuilder().setMessage("hello").build().getSerializedSize()); }
@Override public int getInputSerializedSize(Object input) throws IOException { if (inputCodec != null) { return inputCodec.size(input); } return 0; }
JprotobufRpcMethodInfo extends RpcMethodInfo { @Override public int getInputSerializedSize(Object input) throws IOException { if (inputCodec != null) { return inputCodec.size(input); } return 0; } }
JprotobufRpcMethodInfo extends RpcMethodInfo { @Override public int getInputSerializedSize(Object input) throws IOException { if (inputCodec != null) { return inputCodec.size(input); } return 0; } JprotobufRpcMethodInfo(Method method); }
JprotobufRpcMethodInfo extends RpcMethodInfo { @Override public int getInputSerializedSize(Object input) throws IOException { if (inputCodec != null) { return inputCodec.size(input); } return 0; } JprotobufRpcMethodInfo(Method method); @Override byte[] inputEncode(Object input); @Override void inputWriteToStream(Object input, CodedOutputStream stream); @Override Object outputDecode(byte[] output); @Override Object outputDecode(ByteBuf output); @Override Object outputDecode(DynamicCompositeByteBuf output); @Override Object inputDecode(byte[] input); @Override Object inputDecode(ByteBuf input); @Override Object inputDecode(DynamicCompositeByteBuf input); @Override byte[] outputEncode(Object output); @Override void outputWriteToStream(Object output, CodedOutputStream stream); @Override int getInputSerializedSize(Object input); @Override int getOutputSerializedSize(Object output); }
JprotobufRpcMethodInfo extends RpcMethodInfo { @Override public int getInputSerializedSize(Object input) throws IOException { if (inputCodec != null) { return inputCodec.size(input); } return 0; } JprotobufRpcMethodInfo(Method method); @Override byte[] inputEncode(Object input); @Override void inputWriteToStream(Object input, CodedOutputStream stream); @Override Object outputDecode(byte[] output); @Override Object outputDecode(ByteBuf output); @Override Object outputDecode(DynamicCompositeByteBuf output); @Override Object inputDecode(byte[] input); @Override Object inputDecode(ByteBuf input); @Override Object inputDecode(DynamicCompositeByteBuf input); @Override byte[] outputEncode(Object output); @Override void outputWriteToStream(Object output, CodedOutputStream stream); @Override int getInputSerializedSize(Object input); @Override int getOutputSerializedSize(Object output);  }