eRegister in P2000, AuftragKopie, Auftrag

This commit is contained in:
Stoyan Zlatev
2024-09-13 15:04:57 +02:00
parent 2b301b266c
commit 3a876c0a23
11 changed files with 113 additions and 140 deletions
@@ -5,6 +5,35 @@
public static class BytesExtensions
{
public static Int32 Int32BigEndian(this Byte[] bytes, Int32 start)
{
var _bytes = new Byte[4];
if (bytes.Length >= start + 4)
{
Array.Copy(bytes, start, _bytes, 0, 4);
Array.Reverse(_bytes);
}
return BitConverter.ToInt32(_bytes, 0);
}
public static Byte Byte(this Byte[] bytes, Int32 start)
{
var _byte = default(Byte);
if (bytes.Length > start)
{
_byte = bytes[start];
}
return _byte;
}
public const Int32 Int16Size = sizeof(Int16);
public const Int32 Int32Size = sizeof(Int32);
public const Int32 Int64Size = sizeof(Int64);