Exemple #1
0
        public static int FromInt32(Endianness endianness, byte[] str, int offset)
        {
            switch (endianness)
            {
            case Endianness.LittleEndian:
                return(BitConv.FromInt32(str, offset));

            case Endianness.BigEndian:
                return(BEBitConv.FromInt32(str, offset));

            default:
                throw new ArgumentException("Endianness is invalid.");
            }
        }
Exemple #2
0
        public static void ToInt32(Endianness endianness, byte[] str, int offset, int value)
        {
            switch (endianness)
            {
            case Endianness.LittleEndian:
                BitConv.ToInt32(str, offset, value);
                break;

            case Endianness.BigEndian:
                BEBitConv.ToInt32(str, offset, value);
                break;

            default:
                throw new ArgumentException("Endianness is invalid.");
            }
        }