title: How do you get successive slices out of a ByteBuffer?
body: <p>I have a <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/nio/ByteBuffer.html" rel="noreferrer">ByteBuffer</a> that contains a large file (100 MB):</p>
  
  <pre><code>    java.nio.ByteBuffer byteBuffer = ByteBuffer.wrap(multipartFile.getBytes());
      writeChannel.write(byteBuffer);
      writeChannel.closeFinally();
  </code></pre>
  
  <p>I can only legally write 1 MB to the <code>writeChannel</code> at a time.</p>
  
  <p>How do I slice up the contents of the ByteBuffer and write only a 1 MB slice at a time into the <code>writeChannel</code>?</p>