title: Calculate MD5 hash of file in 10 MB chunks?
body: <p>If you have 100 MB file i want to get ten hashes for each 10 MB segment .
  Also if it is say 101 MB i should get 11 segments of MD5 hash .</p>
  
  <p>I want to use custom digest stream which will return all hashes as list .</p>
  
  <pre><code>public class ChunkedDigestStream extends DigestInputStream {
  
      private final long chunkSize;
      private final List&lt;String&gt; chunkDigests = new ArrayList&lt;&gt;();
      private int count = 0;
  
      public ChunkedDigestStream(InputStream stream, MessageDigest digest, int chunkSize) {
          super(stream, digest);
          this.chunkSize = chunkSize;
  
      }
  
      @Override
      public int read(byte[] b, int off, int len) throws IOException {
  
         // What could be implementation here ?
  }
      public List&lt;String&gt; getChunkDigests() {
          return chunkDigests;
      }
  }
  </code></pre>