code: public static IoBuffer copy(ByteBuffer src) {
          IoBuffer copy = IoBuffer.allocate(src.remaining());
          copy.put(src);
          copy.flip();
          return copy;
      }
docs: Creates a new MINA buffer that is a deep copy of the remaining bytes
  in the given buffer (between index buf.position() and buf.limit())
  
  @param src the buffer to copy
  @return the new buffer, ready to read from