Package org.apache.lucene.store

# Class ByteBuffersDataOutput.ByteBufferRecycler

java.lang.Object
org.apache.lucene.store.ByteBuffersDataOutput.ByteBufferRecycler

Enclosing class:
  `ByteBuffersDataOutput`

public static final class ByteBuffersDataOutput.ByteBufferRecycler extends Object
An implementation of a `ByteBuffer` allocation and recycling policy. The blocks are recycled if exactly the same size is requested, otherwise they're released to be GCed.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ByteBufferRecycler(IntFunction<ByteBuffer> delegate)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ByteBuffer`
  `allocate(int size)`
  `void`
  `reuse(ByteBuffer buffer)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ByteBufferRecycler

    public ByteBufferRecycler(IntFunction<ByteBuffer> delegate)

- ## Method Details

  - ### allocate

    public ByteBuffer allocate(int size)

  - ### reuse

    public void reuse(ByteBuffer buffer)