private static string ReadString(Stream stream)
{
var hasError = false;
var sb = new StringBuilder();
var b = ReadByte(stream);
if (b == 1 || b == 2)
{
hasError = true;
b = ReadByte(stream);
}
var ch = _byteToChar[b];
while (ch != '\n')
{
sb.Append(ch);
b = ReadByte(stream);
ch = _byteToChar[b];
}
if (hasError)
throw new ScpException(sb.ToString());
return sb.ToString();
}
}