DataBufferAdapterFactory

public class DataBufferAdapterFactory

Factory of data buffer adapters.

Data buffer adapters are used to apply a DataLayout to a buffer. Conceptually, they act as a proxy that intercept each I/O call and perform the required type conversions after/before delegating the task to the underlying buffer.

Public Constructors

Public Methods

static <S extends DataBuffer<?>> BooleanDataBuffer
create(S buffer, BooleanDataLayout<S> layout)
Creates an adapter that applies a boolean data layout to the given buffer.
static <S extends DataBuffer<?>> ShortDataBuffer
create(S buffer, ShortDataLayout<S> layout)
Creates an adapter that applies a short data layout to the given buffer.
static <S extends DataBuffer<?>> IntDataBuffer
create(S buffer, IntDataLayout<S> layout)
Creates an adapter that applies a integer data layout to the given buffer.
static <S extends DataBuffer<?>> ByteDataBuffer
create(S buffer, ByteDataLayout<S> layout)
Creates an adapter that applies a byte data layout to the given buffer.
static <S extends DataBuffer<?>> LongDataBuffer
create(S buffer, LongDataLayout<S> layout)
Creates an adapter that applies a long data layout to the given buffer.
static <S extends DataBuffer<?>> DoubleDataBuffer
create(S buffer, DoubleDataLayout<S> layout)
Creates an adapter that applies a double data layout to the given buffer.
static <S extends DataBuffer<?>> FloatDataBuffer
create(S buffer, FloatDataLayout<S> layout)
Creates an adapter that applies a float data layout to the given buffer.
static <S extends DataBuffer<?>, T> DataBuffer<T>
create(S buffer, DataLayout<S, T> layout)
Creates an adapter that applies a data layout to the given buffer.

Inherited Methods

Public Constructors

public DataBufferAdapterFactory ()

Public Methods

public static BooleanDataBuffer create (S buffer, BooleanDataLayout<S> layout)

Creates an adapter that applies a boolean data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter

public static ShortDataBuffer create (S buffer, ShortDataLayout<S> layout)

Creates an adapter that applies a short data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter

public static IntDataBuffer create (S buffer, IntDataLayout<S> layout)

Creates an adapter that applies a integer data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter

public static ByteDataBuffer create (S buffer, ByteDataLayout<S> layout)

Creates an adapter that applies a byte data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter

public static LongDataBuffer create (S buffer, LongDataLayout<S> layout)

Creates an adapter that applies a long data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter

public static DoubleDataBuffer create (S buffer, DoubleDataLayout<S> layout)

Creates an adapter that applies a double data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter

public static FloatDataBuffer create (S buffer, FloatDataLayout<S> layout)

Creates an adapter that applies a float data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter

public static DataBuffer<T> create (S buffer, DataLayout<S, T> layout)

Creates an adapter that applies a data layout to the given buffer.

Parameters
buffer the delegate buffer
layout layout to apply
Returns
  • buffer adapter