Yarhl
Yarhl copied to clipboard
Implement ReadBytesToToken()
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.
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, ...).