public <T> T readValue(final Buffer buffer, final Class<T> type, final boolean nullable) throws IOException {
        if (buffer == null) {
            throw new IllegalArgumentException("input cannot be null.");
        } else if (type == null) {
            throw new IllegalArgumentException("type cannot be null.");
        }

        final TypeSerializer<T> serializer = registry.getSerializer(type);
        return serializer.readValue(buffer, this, nullable);
    }
Reads a value for an specific type.

<p>When the value is nullable, the reader expects the <code>{value_flag}{value}</code> to be contained in the
buffer.</p>

<p>When the value is not nullable, the reader expects only the <code>{value}</code> to be contained in the
buffer.</p>
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/GraphBinaryReader.java