BplusDotNet.BufferFile.RetrieveShort C# (CSharp) Метод

RetrieveShort() публичный статический Метод

public static RetrieveShort ( byte ToArray, int atIndex ) : short
ToArray byte
atIndex int
Результат short
        public static short RetrieveShort(byte[] ToArray, int atIndex)
        {
            int limit=SHORTSTORAGE;
            if (atIndex+limit>ToArray.Length)
            {
                throw new BufferFileException("can't access beyond end of array");
            }
            int result = 0;
            for (int i=0; i<limit; i++)
            {
                byte thebyte = ToArray[atIndex+limit-i-1];
                result = (result << 8);
                result = result | thebyte;
            }
            return (short) result;
        }