Class CachedByteBufferAllocator


  • public class CachedByteBufferAllocator
    extends Object
    A buffer allocator which allocates and caches NIO (direct) byte buffers.
    Version:
    $id$
    Author:
    Matej Sekoranja
    • Field Detail

      • bufferSize

        public static int bufferSize
        This variable stores the size of the NIO byte buffer that should be allocated according to properties.
    • Constructor Detail

      • CachedByteBufferAllocator

        public CachedByteBufferAllocator()
    • Method Detail

      • get

        public ByteBuffer get()
        Get a byte buffer.
        Returns:
        a byte buffer.
      • put

        public void put​(ByteBuffer buffer)
        Return buffer to a cache.
        Parameters:
        buffer - buffer to be returned in the cache.