예제 #1
0
 /**
  * {@inheritdoc}
  * @see \BitWasp\Buffertools\Types\TypeInterface::read()
  */
 public function read(Parser &$parser)
 {
     $math = $this->getMath();
     $uint8 = new Uint8($math);
     $int = $uint8->readBits($parser);
     if ($math->cmp($int, 0xfd) < 0) {
         return $int;
     } else {
         $uint = $this->solveReadSize($int)[0];
         return $uint->read($parser);
     }
 }
예제 #2
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Bit string length must be a multiple of 8
  */
 public function testInvalidFlipLength()
 {
     $math = EccFactory::getAdapter();
     $u = new Uint8($math, 1);
     $u->flipBits('0');
 }