List<string> readstreamdata(string tagstr)
{
int b;
bool stop = false;
List<string> lines = new List<string>();
StringBuilder currentLine = new StringBuilder();
while (!stop)
{
b = stream.ReadByte();
if (b == 10)
{
currentLine.Append(Convert.ToChar(b));
lines.Add(currentLine.ToString());
string line = currentLine.ToString();
currentLine.Clear();
if (line.StartsWith(tagstr))
{
return lines;
}
}
else
{
currentLine.Append(Convert.ToChar(b));
}
}
return lines;
}