You are here

public function PHPExcel_Shared_OLE::getData in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php \PHPExcel_Shared_OLE::getData()

* Gets data from a PPS * If there is no PPS for the index given, it will return an empty string. * * @access public *

Parameters

integer $index The index for the PPS: * @param integer $position The position from which to start reading * (relative to the PPS) * @param integer $length The amount of bytes to read (at most) * @return string The binary string containing the data requested * @see OLE_PPS_File::getStream()

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php, line 410

Class

PHPExcel_Shared_OLE
OLE package base class.

Code

public function getData($index, $position, $length) {

  // if position is not valid return empty string
  if (!isset($this->_list[$index]) || $position >= $this->_list[$index]->Size || $position < 0) {
    return '';
  }
  $fh = $this
    ->getStream($this->_list[$index]);
  $data = stream_get_contents($fh, $length, $position);
  fclose($fh);
  return $data;
}