function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt)
    {
        $FILE = $this->_FILEH_;
  
        // Calculate Basic Setting
        $iBlCnt = $this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE;
        $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / OLE_LONG_INT_SIZE;
  
        $iBdExL = 0;
        $iAll = $iBBcnt + $iPPScnt + $iSBDcnt;
        $iAllW = $iAll;
        $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
        $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
  
        // Calculate BD count
        if ($iBdCnt > $i1stBdL) {
            while (1) {
                $iBdExL++;
                $iAllW++;
                $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
                if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) {
                    break;
                }
            }
        }
  
        // Save Header
        fwrite($FILE,
                  "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . pack("v", 0x3b)
                  . pack("v", 0x03)
                  . pack("v", -2)
                  . pack("v", 9)
                  . pack("v", 6)
                  . pack("v", 0)
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . pack("V", $iBdCnt) 
                  . pack("V", $iBBcnt+$iSBDcnt) //ROOT START
                  . pack("V", 0)
                  . pack("V", 0x1000)
                  . pack("V", 0)                  //Small Block Depot
                  . pack("V", 1)
          );
        // Extra BDList Start, Count
        if ($iBdCnt < $i1stBdL) {
            fwrite($FILE,
                      pack("V", -2).      // Extra BDList Start
                      pack("V", 0)        // Extra BDList Count
                  );
        } else {
            fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL));
        }

        // BDList
        for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; $i++) {
            fwrite($FILE, pack("V", $iAll+$i));
        }
        if ($i < $i1stBdL) {
            for ($j = 0; $j < ($i1stBdL-$i); $j++) {
                fwrite($FILE, (pack("V", -1)));
            }
        }
    }
function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt)
    {
        $FILE = $this->_FILEH_;
  
        // Calculate Basic Setting
        $iBlCnt = $this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE;
        $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / OLE_LONG_INT_SIZE;
  
        $iBdExL = 0;
        $iAll = $iBBcnt + $iPPScnt + $iSBDcnt;
        $iAllW = $iAll;
        $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
        $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
  
        // Calculate BD count
        if ($iBdCnt > $i1stBdL) {
            while (1) {
                $iBdExL++;
                $iAllW++;
                $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
                if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) {
                    break;
                }
            }
        }
  
        // Save Header
        fwrite($FILE,
                  "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . pack("v", 0x3b)
                  . pack("v", 0x03)
                  . pack("v", -2)
                  . pack("v", 9)
                  . pack("v", 6)
                  . pack("v", 0)
                  . "\x00\x00\x00\x00"
                  . "\x00\x00\x00\x00"
                  . pack("V", $iBdCnt) 
                  . pack("V", $iBBcnt+$iSBDcnt) //ROOT START
                  . pack("V", 0)
                  . pack("V", 0x1000)
                  . pack("V", 0)                  //Small Block Depot
                  . pack("V", 1)
          );
        // Extra BDList Start, Count
        if ($iBdCnt < $i1stBdL) {
            fwrite($FILE,
                      pack("V", -2).      // Extra BDList Start
                      pack("V", 0)        // Extra BDList Count
                  );
        } else {
            fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL));
        }

        // BDList
        for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; $i++) {
            fwrite($FILE, pack("V", $iAll+$i));
        }
        if ($i < $i1stBdL) {
            for ($j = 0; $j < ($i1stBdL-$i); $j++) {
                fwrite($FILE, (pack("V", -1)));
            }
        }
    }
function _saveHeader ( $ iSBDcnt , $ iBBcnt , $ iPPScnt ) { $ FILE = $ this -> _FILEH_ ; // Calculate Basic Setting $ iBlCnt = $ this -> _BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE ; $ i1stBdL = ( $ this -> _BIG_BLOCK_SIZE - 0x4C ) / OLE_LONG_INT_SIZE ; $ iBdExL = 0 ; $ iAll = $ iBBcnt + $ iPPScnt + $ iSBDcnt ; $ iAllW = $ iAll ; $ iBdCntW = floor ( $ iAllW / $ iBlCnt ) + ( ( $ iAllW % $ iBlCnt ) ? 1 : 0 ) ; $ iBdCnt = floor ( ( $ iAll + $ iBdCntW ) / $ iBlCnt ) + ( ( ( $ iAllW + $ iBdCntW ) % $ iBlCnt ) ? 1 : 0 ) ; // Calculate BD count if ( $ iBdCnt > $ i1stBdL ) { while ( 1 ) { $ iBdExL ++ ; $ iAllW ++ ; $ iBdCntW = floor ( $ iAllW / $ iBlCnt ) + ( ( $ iAllW % $ iBlCnt ) ? 1 : 0 ) ; $ iBdCnt = floor ( ( $ iAllW + $ iBdCntW ) / $ iBlCnt ) + ( ( ( $ iAllW + $ iBdCntW ) % $ iBlCnt ) ? 1 : 0 ) ; if ( $ iBdCnt <= ( $ iBdExL * $ iBlCnt + $ i1stBdL ) ) { break ; } } } // Save Header fwrite ( $ FILE , "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" . "\x00\x00\x00\x00" . "\x00\x00\x00\x00" . "\x00\x00\x00\x00" . "\x00\x00\x00\x00" . pack ( "v" , 0x3b ) . pack ( "v" , 0x03 ) . pack ( "v" , - 2 ) . pack ( "v" , 9 ) . pack ( "v" , 6 ) . pack ( "v" , 0 ) . "\x00\x00\x00\x00" . "\x00\x00\x00\x00" . pack ( "V" , $ iBdCnt ) . pack ( "V" , $ iBBcnt + $ iSBDcnt ) //ROOT START . pack ( "V" , 0 ) . pack ( "V" , 0x1000 ) . pack ( "V" , 0 ) //Small Block Depot . pack ( "V" , 1 ) ) ; // Extra BDList Start, Count if ( $ iBdCnt < $ i1stBdL ) { fwrite ( $ FILE , pack ( "V" , - 2 ) . // Extra BDList Start pack ( "V" , 0 ) // Extra BDList Count ) ; } else { fwrite ( $ FILE , pack ( "V" , $ iAll + $ iBdCnt ) . pack ( "V" , $ iBdExL ) ) ; } // BDList for ( $ i = 0 ; $ i < $ i1stBdL && $ i < $ iBdCnt ; $ i ++ ) { fwrite ( $ FILE , pack ( "V" , $ iAll + $ i ) ) ; } if ( $ i < $ i1stBdL ) { for ( $ j = 0 ; $ j < ( $ i1stBdL - $ i ) ; $ j ++ ) { fwrite ( $ FILE , ( pack ( "V" , - 1 ) ) ) ; } } }
Save OLE header

@access private
@param integer $iSBDcnt
@param integer $iBBcnt
@param integer $iPPScnt
Save OLE header