code: public static final int move(byte[] buf, int offset, int length, ByteBuffer bb)
      {
          int count = Math.min(length, bb.remaining());
          bb.put(buf, offset, count);
          return count;
      }
docs: Moves bytes from buf to bb as much as is possible. Positions are moved
  according to move.
  @param buf
  @param offset
  @param length
  @param bb
  @return