private static function getIntegerFromBuffer($buffer, &$offset, $delimiter = 'e')
    {
        $numeric = '';
        $offsetMarker = $offset;

        while (($byte = $buffer[$offset++]) !== $delimiter) {
            $numeric .= $byte;
        }

        $integer = (int) $numeric;
        if ($numeric != $integer) {
            throw new DecodingException("Invalid integer: $numeric", $offsetMarker);
        }

        return $integer;
    }
private static function getIntegerFromBuffer($buffer, &$offset, $delimiter = 'e')
    {
        $numeric = '';
        $offsetMarker = $offset;

        while (($byte = $buffer[$offset++]) !== $delimiter) {
            $numeric .= $byte;
        }

        $integer = (int) $numeric;
        if ($numeric != $integer) {
            throw new DecodingException("Invalid integer: $numeric", $offsetMarker);
        }

        return $integer;
    }
private static function getIntegerFromBuffer ( $ buffer , & $ offset , $ delimiter = 'e' ) { $ numeric = '' ; $ offsetMarker = $ offset ; while ( ( $ byte = $ buffer [ $ offset ++ ] ) !== $ delimiter ) { $ numeric .= $ byte ; } $ integer = ( int ) $ numeric ; if ( $ numeric != $ integer ) { throw new DecodingException ( "Invalid integer: $numeric" , $ offsetMarker ) ; } return $ integer ; }
Decodes an integer from the buffer.

@param string $buffer Buffer containing the Bencode string.
@param int $offset Current position in the buffer.
@param string $delimiter Delimiter for the serialized representation of the integer.
@return int
Decodes an integer from the buffer .