public ByteArrayOutputStream readVertexBytes() throws IOException {
        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
        final LinkedList<Byte> buffer = new LinkedList<>();

        int current = read();
        while (current > -1 && (buffer.size() < 12 || !isMatch(buffer))) {
            stream.write(current);

            current = read();
            if (buffer.size() > 11)
                buffer.removeFirst();

            buffer.addLast((byte) current);
        }

        stream.write(current);
        return stream;
    }
Read the bytes of the next {@link Vertex} in the stream. The returned
stream can then be passed to {@link GryoReader#readVertex(java.io.InputStream, java.util.function.Function)}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexByteArrayInputStream.java