use of org.neo4j.kernel.impl.store.StandaloneDynamicRecordAllocator in project neo4j by neo4j.
the class StorePropertyPayloadCursorTest method asBlocks.
private static long[] asBlocks(Object... values) {
DynamicRecordAllocator stringAllocator = new StandaloneDynamicRecordAllocator();
DynamicRecordAllocator arrayAllocator = new StandaloneDynamicRecordAllocator();
long[] blocks = new long[PropertyType.getPayloadSizeLongs()];
int cursor = 0;
for (int i = 0; i < values.length; i++) {
Object value = values[i];
PropertyBlock block = new PropertyBlock();
PropertyStore.encodeValue(block, i, value, stringAllocator, arrayAllocator);
long[] valueBlocks = block.getValueBlocks();
System.arraycopy(valueBlocks, 0, blocks, cursor, valueBlocks.length);
cursor += valueBlocks.length;
}
return blocks;
}
Aggregations