Exemplo n.º 1
0
$bytearray->writeUTF("this is a good test!");
$byte = 1;
$bytearray->writeByte($byte);
$bytearray->writeUTF("this is a good test!");
echo $bytearray->readBoolean();
echo "\n";
echo $bytearray->readUTF();
echo "\n";
echo $bytearray->readByte();
echo "\n";
echo $bytearray->readUTF();
echo "\n";
$a = $bytearray->toString();
var_dump($bytearray);
$b4 = new ByteArray();
$b4->writeInt(strlen($a));
$b4->writeBytes($a);
$len = $b4->readInt();
echo "\n";
echo "read bytes:";
echo $len;
$bytes = $b4->readBytes($len);
echo "\n";
echo "bytes md5:";
echo md5($bytes);
echo "\n";
echo "bytes md5:";
echo md5($a);
echo "\n";
var_dump($b4);
$bytearray->compress();