Package org.h2.mvstore.type
Class ByteArrayDataType
- java.lang.Object
-
- org.h2.mvstore.type.BasicDataType<byte[]>
-
- org.h2.mvstore.type.ByteArrayDataType
-
- All Implemented Interfaces:
java.util.Comparator<byte[]>,DataType<byte[]>
public final class ByteArrayDataType extends BasicDataType<byte[]>
Class ByteArrayDataType.
-
-
Field Summary
Fields Modifier and Type Field Description static ByteArrayDataTypeINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privateByteArrayDataType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[][]createStorage(int size)Create storage object of array type to hold valuesintgetMemory(byte[] data)Calculates the amount of used memory in bytes.byte[]read(java.nio.ByteBuffer buff)Read an object.voidwrite(WriteBuffer buff, byte[] data)Write an object.-
Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, compare, equals, hashCode, isMemoryEstimationAllowed, read, write
-
-
-
-
Field Detail
-
INSTANCE
public static final ByteArrayDataType INSTANCE
-
-
Method Detail
-
getMemory
public int getMemory(byte[] data)
Description copied from interface:DataTypeCalculates the amount of used memory in bytes.- Specified by:
getMemoryin interfaceDataType<byte[]>- Specified by:
getMemoryin classBasicDataType<byte[]>- Parameters:
data- the object- Returns:
- the used memory
-
write
public void write(WriteBuffer buff, byte[] data)
Description copied from interface:DataTypeWrite an object.- Specified by:
writein interfaceDataType<byte[]>- Specified by:
writein classBasicDataType<byte[]>- Parameters:
buff- the target bufferdata- the value
-
read
public byte[] read(java.nio.ByteBuffer buff)
Description copied from interface:DataTypeRead an object.- Specified by:
readin interfaceDataType<byte[]>- Specified by:
readin classBasicDataType<byte[]>- Parameters:
buff- the source buffer- Returns:
- the object
-
createStorage
public byte[][] createStorage(int size)
Description copied from interface:DataTypeCreate storage object of array type to hold values- Parameters:
size- number of values to hold- Returns:
- storage object
-
-