use of org.apache.tinkerpop.shaded.kryo.io.Input in project janusgraph by JanusGraph.
the class JanusGraphIoRegistryTest method testLegacyGeoshapAsGryo.
@Test
public void testLegacyGeoshapAsGryo() {
final Geoshape point = Geoshape.point(1.0d, 4.0d);
Kryo kryo = new Kryo();
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
Output output = new Output(outStream, 4096);
output.writeLong(1);
output.writeFloat((float) point.getPoint().getLatitude());
output.writeFloat((float) point.getPoint().getLongitude());
output.flush();
Geoshape.GeoShapeGryoSerializer serializer = new Geoshape.GeoShapeGryoSerializer();
Input input = new Input(new ByteArrayInputStream(outStream.toByteArray()), 4096);
assertEquals(point, serializer.read(kryo, input, Geoshape.class));
}
Aggregations