Ejemplo n.º 1
0
        public static int smethod_24(byte[] byte_1, bool bool_2)
        {
            if (!(bool_2 ^ BitConverter.IsLittleEndian))
            {
                return(KeyGenerator.BytesToInt(byte_1));
            }
            int num = byte_1.Length;

            switch (num)
            {
            case 2:
                return((int)BitConverter.ToInt16(byte_1, 0));

            case 3:
                break;

            case 4:
                return(BitConverter.ToInt32(byte_1, 0));

            default:
                if (num == 8)                 //i am pretty sure this should just be another switch case but I'm not going to touch it for now
                {
                    return((int)BitConverter.ToInt64(byte_1, 0));
                }
                break;
            }
            throw new Exception();
        }
Ejemplo n.º 2
0
 public int ReadInt(bool ReverseEndianness)
 {
     byte[] array = this.ReadBytes(4, false);
     if (!(ReverseEndianness ^ BitConverter.IsLittleEndian))
     {
         return(KeyGenerator.BytesToInt(array));
     }
     return(BitConverter.ToInt32(array, 0));
 }