Interface Buffers

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Buffers
A strategy for allocating the ByteBuffer into which records are read
Since:
0.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Allocate a buffer configured with this specification
    static Buffers
    direct(int capacity, ByteOrder order)
    Specify a block-aligned direct buffer, rounding capacity up to whole blocks
    static Buffers
    heap(int capacity)
    Specify a little endian heap buffer
    static Buffers
    heap(int capacity, ByteOrder order)
    Specify a heap buffer with the provided byte order
  • Method Details

    • allocate

      ByteBuffer allocate()
      Allocate a buffer configured with this specification
      Returns:
      the allocated buffer
      Since:
      1.0.0
    • heap

      static Buffers heap(int capacity)
      Specify a little endian heap buffer
      Parameters:
      capacity - the capacity in bytes with which to allocate buffers
      Returns:
      the heap buffers
    • heap

      static Buffers heap(int capacity, ByteOrder order)
      Specify a heap buffer with the provided byte order
      Parameters:
      capacity - the capacity in bytes with which to allocate buffers
      order - the byte order to be used in the interpretation of the buffered data
      Returns:
      the heap buffers
    • direct

      static Buffers direct(int capacity, ByteOrder order)
      Specify a block-aligned direct buffer, rounding capacity up to whole blocks
      Parameters:
      capacity - the capacity in bytes with which to allocate buffers, treated as a lower bound
      order - the byte order to be used in the interpretation of the buffered data
      Returns:
      the direct buffers