- 01
 - 02
 - 03
 - 04
 - 05
 - 06
 - 07
 - 08
 - 09
 - 10
 - 11
 - 12
 - 13
 - 14
 - 15
 - 16
 - 17
 - 18
 - 19
 - 20
 - 21
 - 22
 - 23
 - 24
 - 25
 - 26
 - 27
 - 28
 - 29
 
                        int getNextCode(int ¤tByte, int codeLen)
{
    int nextCode = 0, mask;
    mask = (int)pow(2, codeLen) - 1;
    if (rest >= codeLen) {
        nextCode = currentByte & mask;
        currentByte >>= codeLen;
        rest -= codeLen;
    } else {
        int nextByte, temp;
        encoded >> std::hex >> nextByte;
        if (codeLen <= rest + 8) {
            temp = nextByte;
            temp <<= rest;
            temp += currentByte;
            rest = 8 + rest - codeLen;
            currentByte = nextByte >> (8 - rest);
        } else {
            int secondByte;
            encoded >> std::hex >> secondByte;
            temp = secondByte << (rest + 8);
            temp += nextByte + currentByte;
            rest = 16 + rest - codeLen;
            currentByte = secondByte >> (8 - rest);
        }
        nextCode = temp & mask;
    }
    return nextCode;
}
                                     
        
            Функция, для декодера *gif . Считывает несколько бит из файла.