use of com.thinkaurelius.titan.diskstorage.util.ReadArrayBuffer in project titan by thinkaurelius.
the class UUIDSerializerTest method testRoundTrip.
@Test
public void testRoundTrip() {
//Write the UUID
UUIDSerializer serializer = new UUIDSerializer();
UUID uuid1 = UUID.randomUUID();
WriteByteBuffer buffer = new WriteByteBuffer();
serializer.write(buffer, uuid1);
//And read it in again
ReadArrayBuffer readBuffer = new ReadArrayBuffer(buffer.getStaticBuffer().getBytes(0, 16));
UUID uuid2 = serializer.read(readBuffer);
Assert.assertEquals(uuid1, uuid2);
}
Aggregations