Class BufferFactory

    • Constructor Detail

      • BufferFactory

        protected BufferFactory​(boolean allocateDirect)
        Constructs a new BufferFactory with the specified buffer allocation policy.
        Parameters:
        allocateDirect - true to allocate and return BufferWrappers backed by direct buffers, false to allocate and return BufferWrappers backed by non-direct buffers.
      • BufferFactory

        protected BufferFactory()
        Constructs a new BufferFactory with the default buffer allocation policy. This factory allocates and returns BufferWrappers backed by direct buffers.
    • Method Detail

      • isAllocateDirect

        public boolean isAllocateDirect()
        Returns:
        true if this factory allocates and returns BufferWrappers backed by direct buffers, and false if it allocates and return BufferWrappers backed by non-direct buffers.
      • newBuffer

        public abstract BufferWrapper newBuffer​(int size)
        Constructs a new BufferWrapper of the specified size.
        Parameters:
        size - the new buffer's size, in number of underlying data type units (bytes, shorts, ints, floats, or doubles).
        Returns:
        the new buffer.
        Throws:
        java.lang.IllegalArgumentException - if size is negative.