public abstract class BaseDataBuffer extends Object implements DataBuffer
Modifier and Type | Field and Description |
---|---|
protected int |
length |
static int |
MAPPING_SIZE |
protected List<ByteBuffer> |
mappings |
protected RandomAccessFile |
memoryMappedBuffer |
protected String |
path |
DOUBLE, FLOAT
Modifier | Constructor and Description |
---|---|
protected |
BaseDataBuffer(int length) |
Modifier and Type | Method and Description |
---|---|
<E> E[] |
asType()
Returns the element buffer of the specified type.
|
<E> E |
getElement(int i)
Get element i in the buffer as a double
|
int |
length()
Returns the length of the buffer
|
<E> void |
put(int i,
E element)
Assign an element in the buffer to the specified index
|
static byte[] |
toByteArray(double value) |
static byte[] |
toByteArray(float value) |
static byte[] |
toByteArray(int value) |
static double |
toDouble(byte[] bytes) |
static float |
toFloat(byte[] bytes) |
static int |
toInt(byte[] bytes) |
protected int length
protected String path
protected RandomAccessFile memoryMappedBuffer
public static final int MAPPING_SIZE
protected final List<ByteBuffer> mappings
public int length()
DataBuffer
length
in interface DataBuffer
public static byte[] toByteArray(double value)
public static byte[] toByteArray(float value)
public static byte[] toByteArray(int value)
public static double toDouble(byte[] bytes)
public static int toInt(byte[] bytes)
public static float toFloat(byte[] bytes)
public <E> E getElement(int i)
DataBuffer
getElement
in interface DataBuffer
i
- the element to getFloatpublic <E> void put(int i, E element)
DataBuffer
put
in interface DataBuffer
i
- the indexelement
- the element to assignpublic <E> E[] asType()
DataBuffer
asType
in interface DataBuffer
Copyright © 2015. All Rights Reserved.