@SpiMeta(name="compressMotan") public class CompressRpcCodec extends AbstractCodec
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CODEC_VERSION_SWITCHER |
static String |
GROUP_CODEC_VERSION_SWITCHER |
serializations| 构造器和说明 |
|---|
CompressRpcCodec() |
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
compress(byte[] org,
boolean useGzip,
int minGzSize) |
Object |
decode(Channel channel,
String remoteIp,
byte[] data)
decode data
对于client端:主要是来自server端的response or exception
对于server端: 主要是来自client端的request
|
Object |
decodeV2(Channel channel,
String remoteIp,
byte[] data)
decode data
对于client端:主要是来自server端的response or exception
对于server端: 主要是来自client端的request
|
byte[] |
encode(Channel channel,
Object message) |
byte[] |
encodeV2(Channel channel,
Object message) |
static InputStream |
getInputStream(byte[] data)
获取输入流。
|
static void |
putMethodSign(Provider<?> provider,
List<Method> methods) |
static void |
putMethodSign(String methodSign,
com.weibo.api.motan.protocol.rpc.CompressRpcCodec.MethodInfo methodInfo) |
createInput, createOutput, deserialize, getSerializaiontByNum, initAllSerialziation, serializepublic byte[] encode(Channel channel, Object message) throws IOException
IOExceptionpublic Object decode(Channel channel, String remoteIp, byte[] data) throws IOException
对于client端:主要是来自server端的response or exception
对于server端: 主要是来自client端的request
data - remoteIp - 用来在server端decode request时能获取到client的ip。IOExceptionpublic byte[] encodeV2(Channel channel, Object message) throws IOException
IOExceptionpublic Object decodeV2(Channel channel, String remoteIp, byte[] data) throws IOException
对于client端:主要是来自server端的response or exception
对于server端: 主要是来自client端的request
data - IOExceptionpublic static InputStream getInputStream(byte[] data)
data - public byte[] compress(byte[] org,
boolean useGzip,
int minGzSize)
throws IOException
IOExceptionpublic static void putMethodSign(String methodSign, com.weibo.api.motan.protocol.rpc.CompressRpcCodec.MethodInfo methodInfo)
Copyright © 2017. All rights reserved.