public interface Codec
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
decode(byte[] bytes)
Do decode action from byte array
|
byte[] |
encode(Object t)
Do byte encode action
|
Object |
readFrom(com.google.protobuf.CodedInputStream intput)
Read object from target byte array input stream
|
int |
size(Object t)
Calculate size of target object
|
void |
writeTo(Object t,
com.google.protobuf.CodedOutputStream out)
Write target object to byte array
|
byte[] encode(Object t) throws IOException
t - generic target objectIOException - if target object is invalidObject decode(byte[] bytes) throws IOException
bytes - encoded byte arrayIOException - if byte array is invalidint size(Object t) throws IOException
t - target objectIOException - if target object is invalidvoid writeTo(Object t, com.google.protobuf.CodedOutputStream out) throws IOException
t - target objectout - target CodedOutputStreamIOException - if target object is invalidObject readFrom(com.google.protobuf.CodedInputStream intput) throws IOException
intput - target input stream objectIOException - if byte array is invalidCopyright © 2015 Baidu, Inc.. All rights reserved.