title: Reading very large files (~ 1 TB) in sequential blocks
body: <p>I need to read a large file in Scala and process it in blocks of k bits (k could be 65536 typically). As a simple example (but not what I want):</p>
  
  <p>file blocks are <code>(f1, f2, ... fk)</code>.</p>
  
  <p>I want to compute <code>SHA256(f1)+SHA256(f2)+...+ SHA256(fk)</code></p>
  
  <p>Such a computation can be done incrementally using only constant storage and the current block without needing other blocks.  </p>
  
  <p>What is the best way to read the file? (perhaps something that uses continuations?)</p>
  
  <p>EDIT: The linked question kind of solves the problem but not always, as the file I am looking at contains binary data. </p>