use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class OVarIntSerializerTest method serializeZero.
@Test
public void serializeZero() {
BytesContainer bytes = new BytesContainer();
OVarIntSerializer.write(bytes, 0);
bytes.offset = 0;
assertEquals(OVarIntSerializer.readAsLong(bytes), 0l);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class OVarIntSerializerTest method serializeMinLong.
@Test
public void serializeMinLong() {
BytesContainer bytes = new BytesContainer();
bytes.offset = OVarIntSerializer.write(bytes, Long.MIN_VALUE);
assertEquals(OVarIntSerializer.readAsLong(bytes), Long.MIN_VALUE);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class VarIntSpeedTest method cycle.
@Override
@Test(enabled = false)
public void cycle() {
BytesContainer container = new BytesContainer();
OVarIntSerializer.write(container, 20);
OVarIntSerializer.write(container, 200);
OVarIntSerializer.write(container, 20000);
OVarIntSerializer.write(container, 200000000000000000L);
container.offset = 0;
OVarIntSerializer.readAsInteger(container);
OVarIntSerializer.readAsInteger(container);
OVarIntSerializer.readAsInteger(container);
OVarIntSerializer.readAsLong(container);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class AbstractComparatorTest method field.
protected OBinaryField field(final OType type, final Object value, OCollate collate) {
BytesContainer bytes = new BytesContainer();
bytes.offset = serializer.serializeValue(bytes, value, type, null);
return new OBinaryField(null, type, bytes, collate);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class IntgerSerializationSpeedTest method cycle.
@Override
@Test(enabled = false)
public void cycle() {
BytesContainer container = new BytesContainer();
OIntegerSerializer.INSTANCE.serialize(20, container.bytes, container.offset);
container.skip(OIntegerSerializer.INT_SIZE);
OIntegerSerializer.INSTANCE.serialize(200, container.bytes, container.offset);
container.skip(OIntegerSerializer.INT_SIZE);
OIntegerSerializer.INSTANCE.serialize(20000, container.bytes, container.offset);
container.skip(OIntegerSerializer.INT_SIZE);
OLongSerializer.INSTANCE.serialize(200000000000000000L, container.bytes, container.offset);
container.skip(OLongSerializer.LONG_SIZE);
container.offset = 0;
OIntegerSerializer.INSTANCE.deserialize(container.bytes, container.offset);
container.skip(OIntegerSerializer.INT_SIZE);
OIntegerSerializer.INSTANCE.deserialize(container.bytes, container.offset);
container.skip(OIntegerSerializer.INT_SIZE);
OIntegerSerializer.INSTANCE.deserialize(container.bytes, container.offset);
container.skip(OIntegerSerializer.INT_SIZE);
OLongSerializer.INSTANCE.deserialize(container.bytes, container.offset);
container.skip(OLongSerializer.LONG_SIZE);
}
Aggregations