/** * Write a vertex to a stream without writing its edges. * * @param outputStream the stream to write to. * @param vertexIterator a iterator that returns a list of vertices. */ public default void writeVertices(final OutputStream outputStream, final Iterator<Vertex> vertexIterator) throws IOException { while (vertexIterator.hasNext()) { writeVertex(outputStream, vertexIterator.next()); } }
/** * Write a list of vertices from a {@link Traversal} to a stream with its associated edges. Only write edges as * defined by the requested direction. * * @param outputStream the stream to write to. * @param vertexIterator a traversal that returns a list of vertices. * @param direction the direction of edges to write or null if no edges are to be written. */ public default void writeVertices(final OutputStream outputStream, final Iterator<Vertex> vertexIterator, final Direction direction) throws IOException { while (vertexIterator.hasNext()) { writeVertex(outputStream, vertexIterator.next(), direction); } }
private void assertVertexToSerialize(final Vertex toSerialize, final boolean assertProperties) throws IOException { try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) { final GraphWriter writer = writerMaker.apply(graph); writer.writeVertex(os, toSerialize);
writer.writeVertex(os, v1);
writer.writeVertex(os, v1, Direction.OUT);
writer.writeVertex(os, v1, Direction.IN);
writer.writeVertex(os, v1, Direction.BOTH);
/** * Write a vertex to a stream without writing its edges. * * @param outputStream the stream to write to. * @param vertexIterator a iterator that returns a list of vertices. */ public default void writeVertices(final OutputStream outputStream, final Iterator<Vertex> vertexIterator) throws IOException { while (vertexIterator.hasNext()) { writeVertex(outputStream, vertexIterator.next()); } }
/** * Write a list of vertices from a {@link Traversal} to a stream with its associated edges. Only write edges as * defined by the requested direction. * * @param outputStream the stream to write to. * @param vertexIterator a traversal that returns a list of vertices. * @param direction the direction of edges to write or null if no edges are to be written. */ public default void writeVertices(final OutputStream outputStream, final Iterator<Vertex> vertexIterator, final Direction direction) throws IOException { while (vertexIterator.hasNext()) { writeVertex(outputStream, vertexIterator.next(), direction); } }
private void assertVertexToSerialize(final Vertex toSerialize, final boolean assertProperties) throws IOException { try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) { final GraphWriter writer = writerMaker.apply(graph); writer.writeVertex(os, toSerialize);
writer.writeVertex(os, v1);
writer.writeVertex(os, v1, Direction.IN);
writer.writeVertex(os, v1, Direction.BOTH);
writer.writeVertex(os, v1, Direction.OUT);