private void storeRemainingInSession(IoBuffer buf, IoSession session) {
final IoBuffer remainingBuf = new UnderivableBuffer(
IoBuffer.allocate(buf.capacity()).setAutoExpand(true));
remainingBuf.order(buf.order());
remainingBuf.put(buf);
session.setAttribute(BUFFER, remainingBuf);
}
}