LightSerializationContext sc = new LightSerializationContext();
ByteBuffer buffer = ByteBuffer.allocateDirect(102400);
long start = System.currentTimeMillis();
for (int i = 0; i < loops; i++) {
testObject = createTestObject();
sc.serialize(testObject, buffer);
buffer.flip();
channel.write(buffer);
buffer.clear();
}
long total = System.currentTimeMillis()- start;