Yes the integer division in both languages needs to match and the working line is
Dim midOffset As Long = (fileLength / 2)-1