Yarhl icon indicating copy to clipboard operation
Yarhl copied to clipboard

Implement ReadBytesToToken()

Open priverop opened this issue 7 years ago • 1 comments

It would be helpful to have a method in DataReader to read bytes until a token/byte is found. So we can avoid to do this on our programs:

long start = reader.Stream.Position;

while (reader.ReadInt32() != 0){}

long end = reader.Stream.Position - 4;

reader.Stream.Position = start;

It would be also good to have ReadStringToToken(), as it is implemented in TextReader.

priverop avatar Nov 14 '18 00:11 priverop

DataReader.ReadStringToToken() was implemented in Yarhl 3.0 with #137. My concern with this proposal is that we would need to add many methods, one per type of token (byte, short, int, long, signed, unsigned, ...).

pleonex avatar Jul 27 '20 20:07 pleonex