public static TikaInputStream get(byte[] data, Metadata metadata) {
        metadata.set(Metadata.CONTENT_LENGTH, Integer.toString(data.length));
        return new TikaInputStream(new UnsynchronizedByteArrayInputStream(data), new TemporaryResources(),
                data.length, getExtension(metadata));
    }
Creates a TikaInputStream from the given array of bytes. The length of
the array is stored as input metadata in the given metadata instance.
<p>
Note that you must always explicitly close the returned stream as in
some cases it may end up writing the given data to a temporary file.

@param data     input data
@param metadata metadata instance
@return a TikaInputStream instance
tika-core/src/main/java/org/apache/tika/io/TikaInputStream.java