rawData.=$str; } /** * writeByte * * @param int $byte * @return void */ public function writeByte($byte) { $this->rawData.=pack('c',$byte); } /** * writeInt * * @param int $int * @return void */ public function writeInt($int) { $this->rawData.=pack('n',$int); } /** * writeDouble * * @param float $double * @return void */ public function writeDouble($double) { $bin = pack("d",$double); $testEndian = unpack("C*",pack("S*",256)); $bigEndian = !$testEndian[1]==1; if ($bigEndian) $bin = strrev($bin); $this->rawData.=$bin; } /** * writeLong * * @param int $long * @return void */ public function writeLong($long) { $this->rawData.=pack("N",$long); } /** * getRawData * * @return string */ public function getRawData() { return $this->rawData; } }