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; }
public static int Read(byte[] buf, int c, DisplayTextMessage dtm) { dtm.MessageVersionNumber = buf[c]; dtm.AckNumber = BitConverter.ToUInt16(buf, c + 1); dtm.LinesOfText = buf[c + 3]; c += 4; for (byte i = 0; i < dtm.LinesOfText; ++i) { var tm = new TextMessage(); c = TextMessage.Read(buf, c, tm); dtm.TextMessages.Add(tm); } return c; }