code: public static ByteBuffer reallocateDirectNoCleaner(ByteBuffer buffer, int capacity) {
          assert USE_DIRECT_BUFFER_NO_CLEANER;
  
          int len = capacity - buffer.capacity();
          incrementMemoryCounter(len);
          try {
              return PlatformDependent0.reallocateDirectNoCleaner(buffer, capacity);
          } catch (Throwable e) {
              decrementMemoryCounter(len);
              throwException(e);
              return null;
          }
      }
docs: Reallocate a new {@link ByteBuffer} with the given {@code capacity}. {@link ByteBuffer}s reallocated with
  this method <strong>MUST</strong> be deallocated via {@link #freeDirectNoCleaner(ByteBuffer)}.