I read a file into a
ubyte buffer as shown:
\\ ... buffer = cast(ubyte) read( fName ); // Read the entire file as bytestring marker = 0; // Current index to read from, managed manually, :( \\ ...
The data file contains numbers of varying size, and I want to read them sequentially.
I gleaned the following from forum posts:
// Start read at marker, cast as int int rtnVal = peek!(int, Endian.bigEndian)(buffer[marker..$]); marker += 4; // I just peeked 32 bits
The docs imply that I can peek and also advance my index appropriately, but I'm unsure how to specify the return type, endianness, and index pointer all at once. The following does not work:
int rtnVal = buffer.peek(int,Endian.bigEndian)(&marker); // Error: found `,` when expecting `.` following int
What is the idiom / function call that will automatically advance my
marker index variable?