So to save a variable length string in a binary file I first save an integer value for the string length and then I read the string using the previous length value.
Would it be possible to add this method to InputStream
[quote]
Any reason why you chose to use an integer length? Seems like it’d be worse than a null-termination byte, both in terms of space and performance (?)[/quote]
Only because I thought it would be faster to calculate the number of bytes to skip if I didn’t need to read the string. It’s also an old school methodology (Pascal Strings) – so I guess I instinctively revert back to the old days… perhaps I’m just showing my age