public default void writeVertices(final OutputStream outputStream, final Iterator<Vertex> vertexIterator, final Direction direction) throws IOException {
        while (vertexIterator.hasNext()) {
            writeVertex(outputStream, vertexIterator.next(), direction);
        }
    }
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.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/GraphWriter.java