code: public static int fill(ByteBuffer to, byte[] b, int off, int len) {
          int pos = flipToFill(to);
          try {
              int remaining = to.remaining();
              int take = remaining < len ? remaining : len;
              to.put(b, off, take);
              return take;
          } finally {
              flipToFlush(to, pos);
          }
      }
docs: Like append, but does not throw {@link BufferOverflowException}
  
  @param to  Buffer is flush mode
  @param b   bytes to fill
  @param off offset into byte
  @param len length to fill
  @return The position of the valid data before the flipped position.