BonCodeAJP13Namespace.BonCodeAJP13Packet.GetDouble C# (CSharp) Method

GetDouble() protected static method

Get the Double value from the array starting from the position Pos
protected static GetDouble ( byte Data, double &Value, int Pos ) : int
Data byte
Value double
Pos int
return int
        protected static int GetDouble(byte[] Data, ref double Value, int Pos)
        {
            byte[] ValueData = new byte[sizeof(double)];
            Array.Copy(Data, Pos, ValueData, 0, sizeof(double));

            // flipping the Array .... Big Endian ..
            ValueData = FlipArray(ValueData);
            Value = BitConverter.ToDouble(ValueData, 0);
            return Pos + sizeof(double);
        }