Read a binary file into an array

file-io, vb6

Solution

Here's one way, although you are limited to files around 2 GB in size.

  Dim fileNum As Integer
  Dim bytes() As Byte

  fileNum = FreeFile
  Open "C:\test.bin" For Binary As fileNum
  ReDim bytes(LOF(fileNum) - 1)
  Get fileNum, , bytes
  Close fileNum

Problem

What's the fastest way (using VB6) to read an entire, large, binary file into an array?

Original source