refactor: Use Word.ToByteArray in WriteTpktHeader

This commit is contained in:
Michael Croes
2023-07-19 23:30:02 +02:00
parent ebf3da6280
commit 296ead69c7

View File

@@ -12,7 +12,7 @@ namespace S7.Net
private static void WriteTpktHeader(System.IO.MemoryStream stream, int length)
{
stream.Write(new byte[] { 0x03, 0x00 });
stream.Write(Int.ToByteArray((short)length));
stream.Write(Word.ToByteArray((ushort) length));
}
private static void WriteDataHeader(System.IO.MemoryStream stream)