Mina 过滤器的问题?

由于客户端发送的消息以'\0'结尾,在用mina的acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("UTF-8"))));时,无法进handler,所以想不要过滤(注释掉这行代码就能进handler),但是在handler中message不知道怎么拿出中间的byte[]值,代码:
public void messageReceived(IoSession session, Object message)
throws Exception {
log.info("A connection ip is :" + session.getRemoteAddress());
SyncMessage requestMessage = (SyncMessage)message;
TelephoneSyncService service = new TelephoneSyncService();
byte[] byteMsg = service.handleRequest(byte[] b);

    session.write(byteMsg);
}

既然你知道你的消息是以‘\0’结尾的,那里只需要在构造TextLineCodecFactory时指定这个标识就好了啊,而且TextLineCodecFactory也提供了这个接口:
[code="java"]
ProtocolCodecFilter codec = new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("UTF-8") , "\0" , "\0"));
acceptor.getFilterChain().addLast("codec", codec);
[/code]
这样再试试!