NO File, but still a buffer... how?

OK, my challenge is basically this - read a file from a SCSI device through the device manufacturers .dll (got that part, I think - using malloc into a byte array), and then, rather than writing it out to a tempfile and using fseek to step through the file to pull out what I actually need, just hold it in memory (in a byte array, I am assuming?) and go through it and find the correct offsets etc. to load the data - which is only a very small part of the actual file.

My question is: HOW? As you can see by my "name" I am more used to Java and very new to C++, so this is beyond me at the moment.

Any ideas would be appreciated.

Thanks!
http://www.cplusplus.com/reference/iostream/istream/read/

Also, you'll need to get the file size, which can be done with seekg() and tellg().
http://www.cplusplus.com/reference/iostream/istream/seekg/
http://www.cplusplus.com/reference/iostream/istream/tellg/

Remember that the file size limit for 32-bit C++ libraries is 2^31-1 bytes (2 GiB-1 byte).
Last edited on
Topic archived. No new replies allowed.