Class ByteBufferPool

java.lang.Object
org.gridgain.internal.snapshots.buffer.ByteBufferPool

public class ByteBufferPool extends Object
A byte buffer pool with a byte capacity limiting mechanism.
  • Constructor Details

    • ByteBufferPool

      public ByteBufferPool(int capacityLimit, int bufferSize)
      Constructor.
  • Method Details

    • availableCapacity

      public int availableCapacity()
      Returns available buffer pool capacity.
    • bufferSize

      public int bufferSize()
      Returns next allocated byte buffer size.
    • allocate

      public CompletableFuture<DisposableByteBuffer> allocate(ByteOrder byteOrder)
      Returns future with disposable byte buffer reference. Capacity of pool will be reserved until buffer dispose.
      Parameters:
      byteOrder - Buffer byte order.