Package org.h2.mvstore
Class MVStoreTool.GenericDataType
java.lang.Object
org.h2.mvstore.type.BasicDataType<byte[]>
org.h2.mvstore.MVStoreTool.GenericDataType
- All Implemented Interfaces:
Comparator<byte[]>
,DataType<byte[]>
- Enclosing class:
MVStoreTool
A data type that can read any data that is persisted, and converts it to
a byte array.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[][]
createStorage
(int size) Create storage object of array type to hold valuesint
getMemory
(byte[] obj) Calculates the amount of used memory in bytes.boolean
Whether memory estimation based on previously seen values is allowed/desirablebyte[]
read
(ByteBuffer buff) Read an object.void
write
(WriteBuffer buff, byte[] obj) Write an object.Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, compare, equals, hashCode, read, write
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
GenericDataType
private GenericDataType()
-
-
Method Details
-
isMemoryEstimationAllowed
public boolean isMemoryEstimationAllowed()Description copied from interface:DataType
Whether memory estimation based on previously seen values is allowed/desirable- Specified by:
isMemoryEstimationAllowed
in interfaceDataType<byte[]>
- Overrides:
isMemoryEstimationAllowed
in classBasicDataType<byte[]>
- Returns:
- true if memory estimation is allowed
-
getMemory
public int getMemory(byte[] obj) Description copied from interface:DataType
Calculates the amount of used memory in bytes.- Specified by:
getMemory
in interfaceDataType<byte[]>
- Specified by:
getMemory
in classBasicDataType<byte[]>
- Parameters:
obj
- the object- Returns:
- the used memory
-
createStorage
public byte[][] createStorage(int size) Description copied from interface:DataType
Create storage object of array type to hold values- Parameters:
size
- number of values to hold- Returns:
- storage object
-
write
Description copied from interface:DataType
Write an object.- Specified by:
write
in interfaceDataType<byte[]>
- Specified by:
write
in classBasicDataType<byte[]>
- Parameters:
buff
- the target bufferobj
- the value
-
read
Description copied from interface:DataType
Read an object.- Specified by:
read
in interfaceDataType<byte[]>
- Specified by:
read
in classBasicDataType<byte[]>
- Parameters:
buff
- the source buffer- Returns:
- the object
-