- 所有已实现的接口:
DataCodec
业务参数的 proto 编解码器
- 作者:
- 渔民小镇
- 日期:
- 2022-05-18
-
-
方法概要
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
构造器详细资料
-
ProtoDataCodec
public ProtoDataCodec()
-
方法详细资料
-
encode
public byte[] encode(Object data)
将数据对象编码成字节数组
- 指定者:
encode 在接口中 DataCodec
- 参数:
data - 数据对象
- 返回:
- bytes
-
decode
public <T> T decode(byte[] data,
Class<?> dataClass)
将字节数组解码成对象
- 指定者:
decode 在接口中 DataCodec
- 类型参数:
T - t
- 参数:
data - 数据对象的字节
dataClass - 数据对象 class
- 返回:
- 业务参数
-