@Override
    public void writeGraph(final OutputStream outputStream, final Graph g) throws IOException {
        writeVertices(outputStream, g.vertices(), Direction.BOTH);
    }
Writes a {@link Graph} to stream in an adjacency list format where vertices are written with edges from both
directions.  Under this serialization model, edges are grouped by label.

@param outputStream the stream to write to.
@param g the graph to write to stream.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWriter.java