我有一个IOBuffer,它接收一个包含两种数据类型(Object和Long)的InputBuffer。我无法一起阅读这两种数据类型。
protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception
{
String cName = (String)in.getObject();
HashMap<String, Long> backupControllers = (HashMap<String, Long>)in.getObject();
long controllerCapacity = in.getLong();
controllerInfo request = new controllerInfo(cName, backupControllers, controllerCapacity); // this is object data type
long controllerCurrentLoad = in.getLong(); //this is long data type
request.setControllerLoad(controllerCurrentLoad);
out.write(request);
return false;
}
该功能不起作用,我无法读取缓冲区。