13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol\serializer;
26 private function __construct(){
36 while(!$stream->
feof()){
39 $buffer = $stream->
get($length);
53 foreach($packets as $packet){
55 $stream->put($packet);
65 foreach(self::decodeRaw($stream) as $packetBuffer){
66 $packet = $packetPool->
getPacket($packetBuffer);
69 $packet->decode(PacketSerializer::decoder($packetBuffer, 0));
86 foreach($packets as $packet){
87 $serializer = PacketSerializer::encoder();
88 $packet->encode($serializer);
90 $stream->put($serializer->getBuffer());
getPacket(string $buffer)
static encodePackets(BinaryStream $stream, array $packets)
static decodePackets(BinaryStream $stream, PacketPool $packetPool)
static encodeRaw(BinaryStream $stream, array $packets)
static decodeRaw(BinaryStream $stream)
putUnsignedVarInt(int $v)