use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class BytesContainerTest method testSimple.
@Test
public void testSimple() {
BytesContainer bytesContainer = new BytesContainer();
assertNotNull(bytesContainer.bytes);
assertEquals(bytesContainer.offset, 0);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class BytesContainerTest method testBorderReallocSimple.
@Test
public void testBorderReallocSimple() {
BytesContainer bytesContainer = new BytesContainer();
bytesContainer.alloc((short) 1024);
int pos = bytesContainer.alloc((short) 1);
bytesContainer.bytes[pos] = 0;
assertTrue(bytesContainer.bytes.length >= 1025);
assertEquals(bytesContainer.offset, 1025);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class OVarIntSerializerTest method serializePositive.
@Test
public void serializePositive() {
BytesContainer bytes = new BytesContainer();
OVarIntSerializer.write(bytes, 20432343);
bytes.offset = 0;
assertEquals(OVarIntSerializer.readAsLong(bytes), 20432343l);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class OVarIntSerializerTest method serializeCrazyPositive.
@Test
public void serializeCrazyPositive() {
BytesContainer bytes = new BytesContainer();
OVarIntSerializer.write(bytes, 16238);
bytes.offset = 0;
assertEquals(OVarIntSerializer.readAsLong(bytes), 16238l);
}
use of com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer in project orientdb by orientechnologies.
the class OVarIntSerializerTest method serializePosition.
@Test
public void serializePosition() {
BytesContainer bytes = new BytesContainer();
bytes.offset = OVarIntSerializer.write(bytes, 16238);
assertEquals(OVarIntSerializer.readAsLong(bytes), 16238l);
}
Aggregations