0

Say I have a 5 GB file. I want to split it in the following way.

First 100 MB is on the file

The rest go some reserve file

I do not want to use readalllines kind of function because it's too slow for large files.

I do not want to read the whole file to the memory. I want the program to handle only a medium chunk of data at a time.

user4951
  • 32,206
  • 53
  • 172
  • 282

1 Answers1

1

You may use BinaryReader class and its method to read file in chunks.

Dim chunk() As Byte
chunk = br.ReadBytes(1024)
KV Prajapati
  • 93,659
  • 19
  • 148
  • 186