private <I extends InputShim> void readEdges(final KryoShim<I, ?> kryo, final I input, final StarGraph starGraph, final Direction direction) {
        if (kryo.readObject(input, Boolean.class)) {
            final int numberOfUniqueLabels = kryo.readObject(input, Integer.class);
            for (int i = 0; i < numberOfUniqueLabels; i++) {
                final String edgeLabel = kryo.readObject(input, String.class);
                final int numberOfEdgesWithLabel = kryo.readObject(input, Integer.class);
                for (int j = 0; j < numberOfEdgesWithLabel; j++) {
                    final Object edgeId = kryo.readClassAndObject(input);
                    final Object adjacentVertexId = kryo.readClassAndObject(input);
                    if (this.graphFilter.checkEdgeLegality(direction, edgeLabel).positive()) {
                        if (direction.equals(Direction.OUT))
                            starGraph.starVertex.addOutEdge(edgeLabel, starGraph.addVertex(T.id, adjacentVertexId), T.id, edgeId);
                        else
                            starGraph.starVertex.addInEdge(edgeLabel, starGraph.addVertex(T.id, adjacentVertexId), T.id, edgeId);
                    } else if (null != starGraph.edgeProperties) {
                        starGraph.edgeProperties.remove(edgeId);
                    }
                }
            }
        }
    }
If the returned {@link StarGraph} is null, that means that the {@link GraphFilter} filtered the vertex.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphSerializer.java