eRegister in P2000, AuftragKopie, Auftrag
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user