There are MemoryBlock.CString(offset) setter and getter methods, but why are there no BinaryStream.ReadCstring and WriteCString methods? Was it an oversight or is there a reason for not having them? If there is no reason not to have them I'll put in a feature request
Writing an Extends method for BinaryStream.WriteCstring method is simple and would be consistent with the rest of the API (Just write the string and then a Null byte)... But doing ReadCString as an extends would mean (as far as I can see) doing something like read the stream byte by byte until i find a 0 (or reach the end of the MB) - which could be slow...
The better way would likely be to work with the memoryblock and do something like:
Dim S as string = MB.CString(Stream.Position) Stream.Postion = Stream.Postion + S.LenB + 1
So I can't extend BinaryStream unless I also pass in the memoryblock... doable but not consistent with the API...
It really feels like this capability should be built in!