CSReportDll.cImage.getShortFromByteArray C# (CSharp) Метод

getShortFromByteArray() приватный статический Метод

private static getShortFromByteArray ( byte bytes, int index ) : Int16
bytes byte
index int
Результат System.Int16
        private static Int16 getShortFromByteArray(byte[] bytes, int index)
        {
            byte[] int16InBytes = new byte[2];

            Array.Copy(bytes, index, int16InBytes, 0, 2);

            //
            // TODO: after some checking remove
            //
            // MSDN states that we should check architecture but I found that the values in the byte array are
            //      in the correct order
            //
            // If the system architecture is little-endian (that is, little end first),
            // reverse the byte array.
            /*
            if (BitConverter.IsLittleEndian)
                Array.Reverse(intInBytes);
            */
            return BitConverter.ToInt16(int16InBytes, 0);
        }