private void LogBadData(InputByteArray inputArray) { SpecialLogFile.AppendTextLine("Invalid data received from telnet server. " + "Bytes remaining:" + inputArray.RemainingLength); SpecialLogFile.AppendTextLine(inputArray.ToString()); SpecialLogFile.AppendTextLine("input buffer bytes:"); var buf = inputArray.DataBytes; foreach (var textLine in buf.ToHexReport(16)) { SpecialLogFile.AppendTextLine(textLine); } }
private void ThrowInvalidDataReceivedException(InputByteArray inputArray) { SpecialLogFile.AppendTextLine("Invalid data received from telnet server."); SpecialLogFile.AppendTextLine(inputArray.ToString()); SpecialLogFile.AppendTextLine("input buffer bytes:"); var buf = inputArray.DataBytes; foreach (var textLine in buf.ToHexReport(16)) { SpecialLogFile.AppendTextLine(textLine); } throw new Exception("Invalid data received from telnet server. " + "Data dumped to c:\\downloads\\SpecialLog.txt."); }