return reqMetaData;
};
/**将{@link ResponseSocketBlock}转换为{@link ResponseMsg }消息。*/
public static ResponseMsg responseToMessage(ResponseSocketBlock block) {
//1.基本参数
ResponseMsg resMetaData = new ResponseMsg();
resMetaData.setVersion(block.getVersion());//协议版本
resMetaData.setRequestID(block.getRequestID());//请求ID
resMetaData.setStatus(block.getStatus());//响应状态
resMetaData.setSerializeType(getString(block, block.getSerializeType()));//序列化策略
resMetaData.setReturnType(getString(block, block.getReturnType()));//返回类型
resMetaData.setReturnData(block.readPool(block.getReturnData()));//返回数据
//2.Opt参数
short[] oTypes = block.getOptionKeys();
short[] oValues = block.getOptionValues();
for (int i = 0; i < oTypes.length; i++) {
String optKey = getString(block, oTypes[i]);
String optVar = getString(block, oValues[i]);
//
resMetaData.addOption(optKey, optVar);
}
return resMetaData;
};