Stream to pascal string conversion
Posted on 2000-02-27
I need a conversion from TStream to "string", BUT:
- it has to support #0 's in the stream, and thus in the string
- at the end, the string length must be correct.
- it should be lightning fast and efficient.
The best I could make up:
for myInt := 0 to Stream.Size do
Result := Result + myChar;
But as you can see it uses a loop which fills a (dynamic growing) string. I'd like something more like allocate a string or memorypart, do a single conversion (some typecast or whatever) and put it in result. But I don't know how...