Interface StreamingDigester

All Known Implementing Classes:
AbstractStreamingDigester, StreamingMd5Digester, StreamingSha1Digester, StreamingSha256Digester

public interface StreamingDigester
Gradually create a digest for a stream.
Author:
Brett Porter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant ROLE="StreamingDigester.class.getName()"
  • Method Summary

    Modifier and Type
    Method
    Description
    Calculate the current checksum.
    Get the algorithm used for the checksum.
    void
    Reset the hashcode calculation algorithm.
    void
    Update the checksum with the content of the input stream.
  • Field Details

    • ROLE

      static final String ROLE
      Constant ROLE="StreamingDigester.class.getName()"
  • Method Details

    • getAlgorithm

      String getAlgorithm()
      Get the algorithm used for the checksum.
      Returns:
      the algorithm
    • reset

      void reset() throws DigesterException
      Reset the hashcode calculation algorithm. Only useful when performing incremental hashcodes based on repeated use of update(InputStream)
      Throws:
      DigesterException - if there was a problem with the internal message digest
    • calc

      String calc() throws DigesterException
      Calculate the current checksum.
      Returns:
      the current checksum.
      Throws:
      DigesterException - if there was a problem computing the hashcode.
    • update

      void update(InputStream is) throws DigesterException
      Update the checksum with the content of the input stream.
      Parameters:
      is - the input stream
      Throws:
      DigesterException - if there was a problem computing the hashcode.