Use ByteBuffer to avoid one round of copying in RAPServerCodec.java.