Beispiel #1
0
 public function __construct(Buffer $buffer = null, Encoding $encoding = null)
 {
     $this->encoding = $encoding;
     $this->buffer = $buffer;
     $this->headData = $buffer->get(16);
     #head data is 16 bytes
     $this->_attributes = array();
     $this->isMalphormed = true;
     $this->head = $this->decodeHeadFromPacket($this->headData);
 }
Beispiel #2
0
 public function __construct(Buffer $buffer)
 {
     $row = unpack("Vmagic", $buffer->get(4));
     $this->magic = sprintf("%x", $row["magic"]);
 }