Exemple #1
0
 protected function seekToStart(Slice $slice)
 {
     $position = $this->fileObject->ftell();
     $seekTo = $this->startPosition + $slice->getStart() - $position;
     if ($seekTo == 0) {
         return;
     }
     $this->fileObject->fseek($seekTo, SEEK_CUR);
 }
Exemple #2
0
 protected function checkSlice(Slice $slice)
 {
     if ($slice->getFinish() > $this->getLength() || $slice->getStart() < 0) {
         throw new \OutOfBoundsException(sprintf('the slice %s is outside the length %d of this line.', $slice, $this->getLength()));
     }
 }