コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }