Interface Statics

  • public interface Statics
    • Field Detail


        static final LongAdder MEM_USAGE_NATIVE
      • CLEANER

        static final Cleaner CLEANER
      • NO_OP_DROP

        static final Drop<Buffer> NO_OP_DROP

        static final MethodHandle BB_SLICE_OFFSETS

        static final int MAX_BUFFER_SIZE
        The maximum buffer size we support is the maximum array length generally supported by JVMs, because on-heap buffers will be backed by byte-arrays.
        See Also:
        Constant Field Values
    • Method Detail

      • getByteBufferSliceOffsetsMethodHandle

        static MethodHandle getByteBufferSliceOffsetsMethodHandle()
      • getByteBufferPutOffsetsMethodHandle

        static MethodHandle getByteBufferPutOffsetsMethodHandle()
      • convert

        static <T,​R> Drop<R> convert​(Drop<T> drop)
      • assertValidBufferSize

        static void assertValidBufferSize​(long size)
        Check the given size argument is a valid buffer size, or throw an IllegalArgumentException.
        size - The size to check.
        IllegalArgumentException - if the size is not positive, or if the size is too big (over ~2 GB) for a buffer to accommodate.
      • checkImplicitCapacity

        static void checkImplicitCapacity​(int implicitCapacity,
                                          int currentCapacity)
      • checkLength

        static void checkLength​(int length)
      • copyToViaReverseLoop

        static void copyToViaReverseLoop​(Buffer src,
                                         int srcPos,
                                         Buffer dest,
                                         int destPos,
                                         int length)
      • tryGetWritableBufferFromReadableComponent

        static ByteBuffer tryGetWritableBufferFromReadableComponent​(ReadableComponent component)
      • bbslice

        static ByteBuffer bbslice​(ByteBuffer buffer,
                                  int fromOffset,
                                  int length)
        The ByteBuffer slice-with-offset-and-length method is only available from Java 13 and onwards, but we need to support Java 11.
      • bbput

        static void bbput​(ByteBuffer dest,
                          int destPos,
                          ByteBuffer src,
                          int srcPos,
                          int length)
        The ByteBuffer put-buffer-with-offset-and-length method is not available in Java 11.
      • setMemory

        static void setMemory​(ByteBuffer buffer,
                              int length,
                              byte value)
      • unsafeSetDrop

        static void unsafeSetDrop​(ResourceSupport<?,​?> obj,
                                  Drop<?> replacement)
      • equals

        static boolean equals​(Buffer bufferA,
                              Buffer bufferB)
      • equals

        static boolean equals​(Buffer a,
                              int aStartIndex,
                              Buffer b,
                              int bStartIndex,
                              int length)
      • hashCode

        static int hashCode​(Buffer buffer)
      • nativeAddressWithOffset

        static long nativeAddressWithOffset​(long address,
                                            int offset)
        Compute an offset into a native address. Zero is used as a marker for when a native address is not available, and an offset into a zero address will remain zero.
        address - The native address, or zero if no native address is available.
        offset - The offset into the native address we wish to compute.
        An offsetted native address, or zero if no native address was available.
      • nativeAddressOfDirectByteBuffer

        static long nativeAddressOfDirectByteBuffer​(ByteBuffer byteBuffer)