final AtomicInteger called = new AtomicInteger(0);
final KryoReader reader = KryoReader.build()
.custom(graphProvider.createConfiguredGremlinKryo())
.workingDirectory(File.separator + "tmp").create();
try (final VertexByteArrayInputStream vbais = new VertexByteArrayInputStream(new ByteArrayInputStream(os.toByteArray()))) {
reader.readVertex(new ByteArrayInputStream(vbais.readVertexBytes().toByteArray()),
detachedVertex -> {
called.incrementAndGet();
return detachedVertex;
});
reader.readVertex(new ByteArrayInputStream(vbais.readVertexBytes().toByteArray()),
detachedVertex -> {
called.incrementAndGet();
return detachedVertex;
});
}