public static void Write(this byte[] buffer, int offset, UInt128 value, Endianity endianity) { if (ByteArrayExtensions.IsWrongEndianity(endianity)) { value = ByteArrayExtensions.HostToNetworkOrder(value); } ByteArrayExtensions.Write(buffer, offset, value); }
public static void Write(this byte[] buffer, int offset, short value, Endianity endianity) { if (ByteArrayExtensions.IsWrongEndianity(endianity)) { value = ShortExtensions.ReverseEndianity(value); } ByteArrayExtensions.Write(buffer, offset, value); }
public static long ReadLong(this byte[] buffer, int offset, Endianity endianity) { long host = ByteArrayExtensions.ReadLong(buffer, offset); if (ByteArrayExtensions.IsWrongEndianity(endianity)) { host = IPAddress.HostToNetworkOrder(host); } return(host); }
public static UInt128 ReadUInt128(this byte[] buffer, int offset, Endianity endianity) { UInt128 uint128 = ByteArrayExtensions.ReadUInt128(buffer, offset); if (ByteArrayExtensions.IsWrongEndianity(endianity)) { uint128 = ByteArrayExtensions.HostToNetworkOrder(uint128); } return(uint128); }
public static short ReadShort(this byte[] buffer, int offset, Endianity endianity) { short num = ByteArrayExtensions.ReadShort(buffer, offset); if (ByteArrayExtensions.IsWrongEndianity(endianity)) { num = ShortExtensions.ReverseEndianity(num); } return(num); }