You are here

function PHPExcel_Writer_Excel5_BIFFwriter::_addContinue in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php \PHPExcel_Writer_Excel5_BIFFwriter::_addContinue()

* Excel limits the size of BIFF records. In Excel 5 the limit is 2084 bytes. In * Excel 97 the limit is 8228 bytes. Records that are longer than these limits * must be split up into CONTINUE blocks. * * This function takes a long BIFF record and inserts CONTINUE records as * necessary. * *

Parameters

string $data The original binary data to be written: * @return string A very convenient string of continue blocks * @access private

2 calls to PHPExcel_Writer_Excel5_BIFFwriter::_addContinue()
PHPExcel_Writer_Excel5_BIFFwriter::writeData in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php
* General storage function like _append, but returns string instead of modifying $this->_data * *
PHPExcel_Writer_Excel5_BIFFwriter::_append in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php
* General storage function * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php, line 229

Class

PHPExcel_Writer_Excel5_BIFFwriter
PHPExcel_Writer_Excel5_BIFFwriter

Code

function _addContinue($data) {
  $limit = $this->_limit;
  $record = 0x3c;

  // Record identifier
  // The first 2080/8224 bytes remain intact. However, we have to change
  // the length field of the record.
  $tmp = substr($data, 0, 2) . pack("v", $limit) . substr($data, 4, $limit);
  $header = pack("vv", $record, $limit);

  // Headers for continue records
  // Retrieve chunks of 2080/8224 bytes +4 for the header.
  $data_length = strlen($data);
  for ($i = $limit + 4; $i < $data_length - $limit; $i += $limit) {
    $tmp .= $header;
    $tmp .= substr($data, $i, $limit);
  }

  // Retrieve the last chunk of data
  $header = pack("vv", $record, strlen($data) - $i);
  $tmp .= $header;
  $tmp .= substr($data, $i, strlen($data) - $i);
  return $tmp;
}