Interface BufferSource

All Known Implementing Classes:
HeapBufferSource, OffHeapBufferSource, TimingBufferSource

public interface BufferSource
A source of NIO buffers of some type.
  • Method Summary

    Modifier and Type
    Method
    Description
    allocateBuffer(int size)
    Allocates a buffer of the given size.
  • Method Details

    • allocateBuffer

      ByteBuffer allocateBuffer(int size)
      Allocates a buffer of the given size.

      If a suitable buffer cannot be allocated then null should be returned. Implementations may place restrictions on the valid size value they will accept.

      Parameters:
      size - required buffer size
      Returns:
      a buffer of the required size