@Override
    public Vertex readVertex(final InputStream inputStream,
                             final Function<Attachable<Vertex>, Vertex> vertexAttachMethod,
                             final Function<Attachable<Edge>, Edge> edgeAttachMethod,
                             final Direction attachEdgesOfThisDirection) throws IOException {
        // graphson v3 has special handling for generic Map instances, by forcing to linkedhashmap (which is probably
        // what it should have been anyway) stargraph format can remain unchanged across all versions
        final Map<String, Object> vertexData = ((version == GraphSONVersion.V3_0) || (version == GraphSONVersion.V4_0)) ?
                mapper.readValue(inputStream, linkedHashMapTypeReference) : mapper.readValue(inputStream, mapTypeReference);
        final StarGraph starGraph = StarGraphGraphSONDeserializer.readStarGraphVertex(vertexData);
        if (vertexAttachMethod != null) vertexAttachMethod.apply(starGraph.getStarVertex());

        if (vertexData.containsKey(GraphSONTokens.OUT_E) && (attachEdgesOfThisDirection == Direction.BOTH || attachEdgesOfThisDirection == Direction.OUT))
            StarGraphGraphSONDeserializer.readStarGraphEdges(edgeAttachMethod, starGraph, vertexData, GraphSONTokens.OUT_E);

        if (vertexData.containsKey(GraphSONTokens.IN_E) && (attachEdgesOfThisDirection == Direction.BOTH || attachEdgesOfThisDirection == Direction.IN))
            StarGraphGraphSONDeserializer.readStarGraphEdges(edgeAttachMethod, starGraph, vertexData, GraphSONTokens.IN_E);

        return starGraph.getStarVertex();
    }
Read a {@link Vertex} from output generated by any of the {@link GraphSONWriter} {@code writeVertex} or
{@code writeVertices} methods or by {@link GraphSONWriter#writeGraph(OutputStream, Graph)}.

@param inputStream a stream containing at least one {@link Vertex} as defined by the accompanying
                   {@link GraphWriter#writeVertices(OutputStream, Iterator, Direction)} method.
@param vertexAttachMethod a function that creates re-attaches a {@link Vertex} to a {@link Host} object.
@param edgeAttachMethod a function that creates re-attaches a {@link Edge} to a {@link Host} object.
@param attachEdgesOfThisDirection only edges of this direction are passed to the {@code edgeMaker}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java