public static int Read(byte[] buf, int c, TextMessage tm) { tm.LineNumber = buf[c++]; tm.TextLength = buf[c++]; tm.Text = Encoding.ASCII.GetString(buf, c, tm.TextLength); c += tm.TextLength; return c; }