| 构造器和说明 |
|---|
ReflectiveCodec(Class<T> cls) |
| 限定符和类型 | 方法和说明 |
|---|---|
T |
decode(byte[] bytes)
Do decode action from byte array
|
byte[] |
encode(T t)
Do byte encode action
|
T |
readFrom(com.google.protobuf.CodedInputStream input)
Read object from target byte array input stream
|
int |
size(T t)
Calculate size of target object
|
void |
writeTo(T t,
com.google.protobuf.CodedOutputStream out)
Write target object to byte array
|
public byte[] encode(T t) throws IOException
Codecencode 在接口中 Codec<T>t - generic target objectIOException - if target object is invalidpublic T decode(byte[] bytes) throws IOException
Codecdecode 在接口中 Codec<T>bytes - encoded byte arrayIOException - if byte array is invalidpublic int size(T t) throws IOException
Codecsize 在接口中 Codec<T>t - target objectIOException - if target object is invalidpublic void writeTo(T t, com.google.protobuf.CodedOutputStream out) throws IOException
CodecwriteTo 在接口中 Codec<T>t - target objectout - target CodedOutputStreamIOException - if target object is invalidpublic T readFrom(com.google.protobuf.CodedInputStream input) throws IOException
CodecreadFrom 在接口中 Codec<T>IOException - if byte array is invalidCopyright © 2016 Baidu, Inc.. All rights reserved.