private void digestFile(File f, long sz, Metadata m) throws IOException {
        //only add it if it hasn't been populated already
        if (StringUtils.isBlank(m.get(Metadata.CONTENT_LENGTH))) {
            if (sz < 0) {
                sz = f.length();
            }
            setContentLength(sz, m);
        }
        try (InputStream is = new FileInputStream(f)) {
            digestStream(is, m);
        }
    }
@param is           InputStream to digest. Best to use a TikaInputStream because
                    of potential need to spool to disk.  InputStream must
                    support mark/reset.
@param metadata     metadata in which to store the digest information
@param parseContext ParseContext -- not actually used yet, but there for future expansion
@throws IOException on IO problem or IllegalArgumentException if algorithm couldn't be found
tika-core/src/main/java/org/apache/tika/parser/digest/InputStreamDigester.java