private function _load21DelFile()
    {
        $delFile = $this->_directory->getFileObject($this->_name . '_' . base_convert($this->_delGen, 10, 36) . '.del');

        $format = $delFile->readInt();

        if ($format == (int)0xFFFFFFFF) {
            if (extension_loaded('bitset')) {
                $deletions = bitset_empty();
            } else {
                $deletions = array();
            }

            $byteCount = $delFile->readInt();
            $bitCount  = $delFile->readInt();

            $delFileSize = $this->_directory->fileLength($this->_name . '_' . base_convert($this->_delGen, 10, 36) . '.del');
            $byteNum = 0;

            do {
                $dgap = $delFile->readVInt();
                $nonZeroByte = $delFile->readByte();

                $byteNum += $dgap;


                if (extension_loaded('bitset')) {
                    for ($bit = 0; $bit < 8; $bit++) {
                        if ($nonZeroByte & (1<<$bit)) {
                            bitset_incl($deletions, $byteNum*8 + $bit);
                        }
                    }
                    return $deletions;
                } else {
                    for ($bit = 0; $bit < 8; $bit++) {
                        if ($nonZeroByte & (1<<$bit)) {
                            $deletions[$byteNum*8 + $bit] = 1;
                        }
                    }
                    return (count($deletions) > 0) ? $deletions : null;
                }

            } while ($delFile->tell() < $delFileSize);
        } else {
            // $format is actually byte count
            $byteCount = ceil($format/8);
            $bitCount  = $delFile->readInt();

            if ($bitCount == 0) {
                $delBytes = '';
            } else {
                $delBytes = $delFile->readBytes($byteCount);
            }

            if (extension_loaded('bitset')) {
                return $delBytes;
            } else {
                $deletions = array();
                for ($count = 0; $count < $byteCount; $count++) {
                    $byte = ord($delBytes[$count]);
                    for ($bit = 0; $bit < 8; $bit++) {
                        if ($byte & (1<<$bit)) {
                            $deletions[$count*8 + $bit] = 1;
                        }
                    }
                }

                return (count($deletions) > 0) ? $deletions : null;
            }
        }
    }
private function _load21DelFile()
    {
        $delFile = $this->_directory->getFileObject($this->_name . '_' . base_convert($this->_delGen, 10, 36) . '.del');

        $format = $delFile->readInt();

        if ($format == (int)0xFFFFFFFF) {
            if (extension_loaded('bitset')) {
                $deletions = bitset_empty();
            } else {
                $deletions = array();
            }

            $byteCount = $delFile->readInt();
            $bitCount  = $delFile->readInt();

            $delFileSize = $this->_directory->fileLength($this->_name . '_' . base_convert($this->_delGen, 10, 36) . '.del');
            $byteNum = 0;

            do {
                $dgap = $delFile->readVInt();
                $nonZeroByte = $delFile->readByte();

                $byteNum += $dgap;


                if (extension_loaded('bitset')) {
                    for ($bit = 0; $bit < 8; $bit++) {
                        if ($nonZeroByte & (1<<$bit)) {
                            bitset_incl($deletions, $byteNum*8 + $bit);
                        }
                    }
                    return $deletions;
                } else {
                    for ($bit = 0; $bit < 8; $bit++) {
                        if ($nonZeroByte & (1<<$bit)) {
                            $deletions[$byteNum*8 + $bit] = 1;
                        }
                    }
                    return (count($deletions) > 0) ? $deletions : null;
                }

            } while ($delFile->tell() < $delFileSize);
        } else {
            // $format is actually byte count
            $byteCount = ceil($format/8);
            $bitCount  = $delFile->readInt();

            if ($bitCount == 0) {
                $delBytes = '';
            } else {
                $delBytes = $delFile->readBytes($byteCount);
            }

            if (extension_loaded('bitset')) {
                return $delBytes;
            } else {
                $deletions = array();
                for ($count = 0; $count < $byteCount; $count++) {
                    $byte = ord($delBytes[$count]);
                    for ($bit = 0; $bit < 8; $bit++) {
                        if ($byte & (1<<$bit)) {
                            $deletions[$count*8 + $bit] = 1;
                        }
                    }
                }

                return (count($deletions) > 0) ? $deletions : null;
            }
        }
    }
private function _load21DelFile ( ) { $ delFile = $ this -> _directory -> getFileObject ( $ this -> _name . '_' . base_convert ( $ this -> _delGen , 10 , 36 ) . '.del' ) ; $ format = $ delFile -> readInt ( ) ; if ( $ format == ( int ) 0xFFFFFFFF ) { if ( extension_loaded ( 'bitset' ) ) { $ deletions = bitset_empty ( ) ; } else { $ deletions = array ( ) ; } $ byteCount = $ delFile -> readInt ( ) ; $ bitCount = $ delFile -> readInt ( ) ; $ delFileSize = $ this -> _directory -> fileLength ( $ this -> _name . '_' . base_convert ( $ this -> _delGen , 10 , 36 ) . '.del' ) ; $ byteNum = 0 ; do { $ dgap = $ delFile -> readVInt ( ) ; $ nonZeroByte = $ delFile -> readByte ( ) ; $ byteNum += $ dgap ; if ( extension_loaded ( 'bitset' ) ) { for ( $ bit = 0 ; $ bit < 8 ; $ bit ++ ) { if ( $ nonZeroByte & ( 1 << $ bit ) ) { bitset_incl ( $ deletions , $ byteNum * 8 + $ bit ) ; } } return $ deletions ; } else { for ( $ bit = 0 ; $ bit < 8 ; $ bit ++ ) { if ( $ nonZeroByte & ( 1 << $ bit ) ) { $ deletions [ $ byteNum * 8 + $ bit ] = 1 ; } } return ( count ( $ deletions ) > 0 ) ? $ deletions : null ; } } while ( $ delFile -> tell ( ) < $ delFileSize ) ; } else { // $format is actually byte count $ byteCount = ceil ( $ format / 8 ) ; $ bitCount = $ delFile -> readInt ( ) ; if ( $ bitCount == 0 ) { $ delBytes = '' ; } else { $ delBytes = $ delFile -> readBytes ( $ byteCount ) ; } if ( extension_loaded ( 'bitset' ) ) { return $ delBytes ; } else { $ deletions = array ( ) ; for ( $ count = 0 ; $ count < $ byteCount ; $ count ++ ) { $ byte = ord ( $ delBytes [ $ count ] ) ; for ( $ bit = 0 ; $ bit < 8 ; $ bit ++ ) { if ( $ byte & ( 1 << $ bit ) ) { $ deletions [ $ count * 8 + $ bit ] = 1 ; } } } return ( count ( $ deletions ) > 0 ) ? $ deletions : null ; } } }
Load 2.1+ format detetions file

Returns bitset or an array depending on bitset extension availability

@return mixed
Load 2 . 1 + format detetions file