VB arrays are declared using the upper bound, not the length. So use:
Dim tempBytes(If(dataLength - maxLength * i > maxLength, maxLength, dataLength - maxLength * i) - 1) As Byte
Also, you should use VB integer division for the following:
Dim iterations As Integer = dataLength \ maxLength