public class SimpleMapSerializer extends Object
| 构造器和说明 |
|---|
SimpleMapSerializer() |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,String> |
decode(byte[] bytes)
简单 map 的反序列化过程, 用来反序列化 bolt 的 header
SofaRpcSerialization.deserializeHeader(com.alipay.remoting.rpc.RequestCommand) |
byte[] |
encode(Map<String,String> map)
简单 map 的序列化过程, 用来序列化 bolt 的 header
|
int |
readInt(InputStream in)
InputStream.read 仅 read 一个 byte
|
protected String |
readString(InputStream in)
读取一个字符串
|
protected void |
writeString(OutputStream out,
String str)
写一个String
|
public byte[] encode(Map<String,String> map) throws com.alipay.remoting.exception.SerializationException
map - bolt headercom.alipay.remoting.exception.SerializationException - SerializationExceptionpublic Map<String,String> decode(byte[] bytes) throws com.alipay.remoting.exception.DeserializationException
SofaRpcSerialization.deserializeHeader(com.alipay.remoting.rpc.RequestCommand)
bytes - bolt headercom.alipay.remoting.exception.DeserializationException - DeserializationExceptionprotected void writeString(OutputStream out, String str) throws IOException
out - 输出流str - 字符串IOException - 写入异常protected String readString(InputStream in) throws IOException
in - 输入流程IOException - 读取异常public int readInt(InputStream in) throws IOException
in - InputStreamIOException - if an I/O error occurs.Copyright © 2008–2018 The Ant Financial. All rights reserved.