Hello. Please do forgive my terminology, been awhile since I coded much and age has fogged things up lol.
I've used search a good deal, but haven't found a good thread yet to help me.
The goal is pretty simple I would think though, although I am not sure how to begin. What I want to do is take any file and open it raw, like how you would see the data if you opened it in a hex editor (although I only want to "read" a chunk of the file).
Next, I would like to parse or step through a certain number of bits or bytes, or characters, however you want to look at it, and do something with these chunks of data.
For example, in a hex editor you would start at offset 00 and end at offset 0F. The next "line" (although its not really a line) starts at off at 10 and ends at offset 1F, and so on until the end of the file.
In the past I have opened text files raw, and stepped through them looking for characters like 0D 0A and then converting to and from different types. But what I am wanting to learn how to do is read a segment or chunk of a given file, store it or whatever, then continue from the next offset to another given offset, read that, do something with it, and keep going until the end of the file.
Now I understand that I could use a file open and read binary or raw, but I anticipate that I might want to open a large file, lets say 200mb, and I don't want to actually open the whole thing into memory, but instead would want to read a portion, then another portion, so on and so on.
What I am having a hard time understanding is just how I could do this. I assume I would need to find the last addressable offset somehow, then open the first chunk, record my position, then read the next chunk.
I have thought about doing this many times in the past, and finally found a little extra time to learning something new. I don't expect any code to be handed to me. I know full well I need to do the work. But is there anybody who might want to either give me some good pointers on how to start understanding this, or does understand it (and what I am asking lol) and could explain a few things to me. I am confident that I can do this, but don't really understand what to look for in way of help. It may just be getting the terminology correct, as I've forgotten much from not using what I knew
Thanks to any takers.