use of com.hazelcast.internal.nio.BufferObjectDataOutput in project hazelcast by hazelcast.
the class RingbufferContainerSerializationTest method clone.
private RingbufferContainer clone(RingbufferContainer original) {
BufferObjectDataOutput out = serializationService.createObjectDataOutput(100000);
try {
out.writeObject(original);
byte[] bytes = out.toByteArray();
sleepMillis(CLOCK_DIFFERENCE_MS);
BufferObjectDataInput in = serializationService.createObjectDataInput(bytes);
RingbufferContainer clone = in.readObject();
return clone;
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
closeResource(out);
}
}
Aggregations