title: Custom File encryption, weird exception
body: <p>I'm messing around with file encryption, and I can't seem to get this to work. I'm trying to split a file into even blocks of bytes, unless the file is not divisible by 555 in which case I will store the remaining bytes in the last index of the 2d array. So to put it visually the bytes should look like this:</p>
  
  <ol>
  <li>aaaaaaaaaaaaa</li>
  <li>aaaaaaaaaaaaa</li>
  <li>aaaaaaaaaaaaa</li>
  <li>aaa</li>
  </ol>
  
  <p>The debugger is saying the index is out of range on the line where I increment ii, but the index is not out of range... I've be at this for awhile and I think I need a new set of eyes for this. Any help would be appreciated.</p>
  
  <p>Function blocks(ByVal data As Array)</p>
  
  <pre><code>    Dim out As New List(Of Byte)
      Dim remainder As Integer = data.Length Mod 555 ' Also will be the last block size
      Dim blockSize As Integer = (data.Length - remainder) / 555 'The other blocks length
      Dim hold(555, blockSize) As Byte
  
      Dim i As Integer = 0
      Dim ii As Integer = 0
  
      Do Until i &gt;= 555
          Do Until ii &gt;= blockSize
              hold(i, ii) = data(ii)
              ii += 1
          Loop
          blockSize += blockSize
          i += 1
      Loop
  
  
      Return out.ToArray
  End Function
  </code></pre>