예제 #1
0
파일: PMGI.php 프로젝트: mlocati/chm-lib
 /**
  * Initializes the instance.
  *
  * @param Reader $reader The reader that provides the data.
  *
  * @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
  * @throws Exception Throws an Exception in case of errors.
  */
 public function __construct(Reader $reader)
 {
     parent::__construct($reader);
     if ($this->headerSignature !== 'PMGI') {
         throw UnexpectedHeaderException::create('PMGI', $this->headerSignature);
     }
     $this->freeSpace = $reader->readUInt32();
 }
예제 #2
0
파일: PMGL.php 프로젝트: mlocati/chm-lib
 /**
  * Initializes the instance.
  *
  * @param Reader $reader The reader that provides the data.
  *
  * @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
  * @throws Exception Throws an Exception in case of errors.
  */
 public function __construct(Reader $reader)
 {
     parent::__construct($reader);
     if ($this->headerSignature !== 'PMGL') {
         throw UnexpectedHeaderException::create('PMGL', $this->headerSignature);
     }
     $this->freeSpace = $reader->readUInt32();
     /* Unknown (0) */
     $reader->readUInt32();
     $this->previousChunk = $reader->readInt32();
     $this->nextChunk = $reader->readInt32();
 }
예제 #3
0
파일: LZXC.php 프로젝트: mlocati/chm-lib
 /**
  * Initializes the instance.
  *
  * @param Reader $reader The reader that provides the data.
  *
  * @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
  * @throws Exception Throws an Exception in case of errors.
  */
 public function __construct(Reader $reader)
 {
     $size = $reader->readUInt32();
     if ($size < 6) {
         throw new Exception('The LZXC entry is too small');
     }
     parent::__construct($reader);
     if ($this->headerSignature !== 'LZXC') {
         throw UnexpectedHeaderException::create('LZXC', $this->headerSignature);
     }
     $this->version = $reader->readUInt32();
     if ($this->version !== 2) {
         throw new Exception("Unsupported LZXC header version: {$this->version}");
     }
     $this->resetInterval = $reader->readUInt32();
     $this->windowSize = $reader->readUInt32();
     $this->cacheSize = $reader->readUInt32();
 }
예제 #4
0
 /**
  * Initializes the instance.
  *
  * @param Reader $reader The reader that provides the data.
  *
  * @throws \Exception Throws an Exception in case of errors.
  */
 public function __construct(Reader $reader)
 {
     parent::__construct($reader);
     $this->headerVersion = $reader->readUInt32();
     $this->headerLength = $reader->readUInt32();
 }