Reading parts of large files from drive

前端 未结 3 1112
伪装坚强ぢ
伪装坚强ぢ 2020-12-19 16:30

I\'m working with large files in C# (can be up to 20%-40% of available memory) and I will only need small parts of the files to be loaded into memory at a time (like 1-2% of

3条回答
  •  死守一世寂寞
    2020-12-19 16:49

    I know nothing about the structure of these files, but reading a portion of a file with FileStream or similar sounds like the best and fastest way to do it.

    You will not need to copy the byte[] since FileStream can read directly into a byte array.

    It sounds like you might know more about the structure of the file, which could bring up additional techniques as well. But if you need to read only a portion of the file, then this would probably be the way to do it.

提交回复
热议问题