public class TarsCodec extends Codec
charsetNamegetCharsetName, setCharsetNamepublic TarsCodec(String charsetName)
public IoBuffer encodeResponse(Response resp, Session session) throws ProtocolException
protected byte[] encodeResult(TarsServantResponse response, String charsetName)
protected byte[] encodeJsonResult(TarsServantResponse response, String charsetName)
protected byte[] encodeWupResult(TarsServantResponse response, String charsetName)
public IoBuffer encodeRequest(Request req, Session session) throws ProtocolException
protected byte[] encodeRequestParams(TarsServantRequest request, String charsetName) throws ProtocolException
public Request decodeRequest(IoBuffer buffer, Session session) throws ProtocolException
public ServantRequest decodeRequestBody(ServantRequest req)
protected Object[] decodeRequestBody(byte[] data, String charset, TarsMethodInfo methodInfo) throws Exception
Exceptionprotected Object[] decodeRequestWupBody(byte[] data, int version, String charset, TarsMethodInfo methodInfo) throws Exception
Exceptionprotected Object[] decodeRequestJsonBody(byte[] data, String charset, TarsMethodInfo methodInfo) throws Exception
Exceptionpublic Response decodeResponse(IoBuffer buffer, Session session) throws ProtocolException
public void decodeResponseBody(ServantResponse resp) throws ProtocolException
protected Object[] decodeResponseBody(byte[] data, String charset, TarsMethodInfo methodInfo) throws Exception
Exceptionpublic Object[] decodeCallbackArgs(TarsServantResponse response) throws ProtocolException
protected Object[] decodeCallbackArgs(byte[] data, String charset, TarsMethodInfo methodInfo) throws ProtocolException, NoSuchMethodException, Exception
protected ClassLoader resolveProtocolClassLoader()
public String getProtocol()
getProtocol 在类中 CodecCopyright © 2020. All Rights Reserved.