@Override
    public void close() throws IOException {
        super.close();

        closed = true;
        if ( byteOffset > 0 ) {
            checksums.add(digestInputStream.getMessageDigest().digest());
        }
    }
Digests the current part of the message, if necessary, and resets digest
state.
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/internal/TreeHashInputStream.java