Example #1
0
 public function readEntryTime(Reader $reader)
 {
     $time_lsb32 = $reader->readInt32BE();
     $time_nsec = $reader->readUInt32BE();
     $time = (double) $time_lsb32 + (double) ("0." . $time_nsec);
     return $time;
 }
Example #2
0
 /**
  * Constructs the Iodophor\Io\FileReader class with given path to the file. By
  * default the file is opened in read (rb) mode.
  *
  * @param string $filename The path to the file.
  * @throws Iodophor\Io\Exception if the file cannot be read
  */
 public function __construct($filename, $mode = null)
 {
     if ($mode === null) {
         $mode = 'rb';
     }
     if (!file_exists($filename) || !is_readable($filename) || ($fd = fopen($filename, $mode)) === false) {
         throw new IoException('Unable to open file for reading: ' . $filename);
     }
     parent::__construct($fd);
 }