What is the correct way to read a binary file in chunks of a fixed size and store all of those chunks into a Vec?
问题 I'm having trouble with opening a file. Most examples read files into a String or read the entire file into a Vec . What I need is to read a file into chunks of a fixed size and store those chunks into an array ( Vec ) of chunks. For example, I have a file called my_file of exactly 64 KB size and I want to read it in chunks of 16KB so I would end up with an Vec of size 4 where each element is another Vec with size 16Kb (0x4000 bytes). After reading the docs and checking other Stack Overflow