Share via

BinaryReader.Read dont support long values?

Steven Young 261 Reputation points
2021-06-26T21:52:01.917+00:00

I need to use BinaryReader.Read to read the file that more than 2GB (greater than the integer value range), the function parameters only support int32.

_BinaryReader.Read(_Buffer, 0, ChunkSize) 'ChunkSize value is 5GB (5,368,709,120), it's long value.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


Answer accepted by question author

  1. Sam of Simple Samples 5,586 Reputation points
    2021-06-27T17:34:36.37+00:00

    Can you use a Memory Mapped File? MemoryMappedFile Class says:

    Memory-mapped files enable programmers to work with extremely large files

    So that appears to be what Microsoft intends to be used for such large files.

    Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.