public static Metadata fromJson(Reader reader) throws IOException {
        Metadata m = null;
        try (JsonParser jParser = new JsonFactory()
                .setStreamReadConstraints(StreamReadConstraints
                        .builder()
                        .maxStringLength(TikaConfig.getMaxJsonStringFieldLength())
                        .build())
                .createParser(CloseShieldReader.wrap(reader))) {
            m = readMetadataObject(jParser);
        }
        return m;
    }
Read metadata from reader.
<p>
This does not close the reader.

@param reader reader to read from
@return Metadata or null if nothing could be read from the reader
@throws IOException in case of parse failure or IO failure with Reader
tika-serialization/src/main/java/org/apache/tika/serialization/JsonMetadata.java