Class CancellableDigestOutputStream

    • Field Detail

      • BYTES_TO_WRITE_BEFORE_CANCEL_CHECK

        public static final int BYTES_TO_WRITE_BEFORE_CANCEL_CHECK
        The OutputStream checks every this value for cancellation
        See Also:
        Constant Field Values
    • Constructor Detail

      • CancellableDigestOutputStream

        public CancellableDigestOutputStream​(ProgressMonitor writeMonitor,
                                             OutputStream out)
        Initialize a CancellableDigestOutputStream.
        Parameters:
        writeMonitor - monitor to update on output progress and check cancel.
        out - target stream to receive all contents.
    • Method Detail

      • getWriteMonitor

        public final ProgressMonitor getWriteMonitor()
        Get the monitor which is used to update on output progress and check cancel.
        Returns:
        the monitor
      • getDigest

        public final byte[] getDigest()
        Obtain the current SHA-1 digest.
        Returns:
        SHA-1 digest
      • length

        public final long length()
        Get total number of bytes written since stream start.
        Returns:
        total number of bytes written since stream start.