public String getTreeHash() throws IOException {
        if ( !closed ) {
            throw new IOException("Stream must be closed before getting the tree hash");
        }
        return TreeHashGenerator.calculateTreeHash(getChecksums());
    }
Returns the list of one-megabyte checksums for this input stream. Only
valid once the stream has been closed.

@throws IOException
            If the stream hasn't been closed.
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/internal/TreeHashInputStream.java