Esempio n. 1
0
 /**
  * @return ExtendedHeader
  */
 private function readExtendedHeader()
 {
     $extendedHeader = new ExtendedHeader();
     $extendedHeader->setSize($this->getBinaryReader()->readUInt8WithDiscardedMsb(4));
     $extendedHeader->setFlagBytesNumber($this->getBinaryReader()->readUInt8());
     $extendedHeader->setFlags($this->getBinaryReader()->readBytes($extendedHeader->getFlagBytesNumber()));
     if ($extendedHeader->hasTagUpdate()) {
         $tagUpdateFlagDataLength = $this->getBinaryReader()->readUInt8();
         if ($tagUpdateFlagDataLength) {
             //left if this flag will get ever data attached to it
         }
     }
     if ($extendedHeader->hasCrcData()) {
         $crcDataFlagDataLength = $this->getBinaryReader()->readUInt8();
         if ($crcDataFlagDataLength) {
             $extendedHeader->setCrcData($this->getBinaryReader()->readUInt8WithDiscardedMsb($crcDataFlagDataLength));
         }
     }
     if ($extendedHeader->hasTagRestrictions()) {
         $tagRestrictionsFlagDataLength = $this->getBinaryReader()->readUInt8();
         if ($tagRestrictionsFlagDataLength) {
             $extendedHeader->getTagRestrictions()->setFlags($this->getBinaryReader()->readUInt8());
         }
     }
     return $extendedHeader;
 }
 /**
  * @dataProvider exceptionForOnlyIntegerProvider
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Size must be an integer
  */
 public function testSetSizeWithInvalidArgument($argument)
 {
     $this->extendedHeader->setSize($argument);
 }