Re: read/peek and automatically advance index in buffer

2023-03-16 Thread jwatson-CO-edu via Digitalmars-d-learn
On Thursday, 16 March 2023 at 18:58:18 UTC, ag0aep6g wrote: On Thursday, 16 March 2023 at 18:39:00 UTC, jwatson-CO-edu wrote: ```d int rtnVal = buffer.peek(int,Endian.bigEndian)(&marker); // Error: found `,` when expecting `.` following int ``` You just forgot the exclamation mark there. "th

Re: read/peek and automatically advance index in buffer

2023-03-16 Thread ag0aep6g via Digitalmars-d-learn
On Thursday, 16 March 2023 at 18:39:00 UTC, jwatson-CO-edu wrote: ```d int rtnVal = buffer.peek(int,Endian.bigEndian)(&marker); // Error: found `,` when expecting `.` following int ``` You just forgot the exclamation mark there.

read/peek and automatically advance index in buffer

2023-03-16 Thread jwatson-CO-edu via Digitalmars-d-learn
I read a file into a `ubyte` buffer as shown: ```d \\ ... 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