private function writeRemainingLength(PacketStream $stream)
    {
        $x = $this->remainingPacketLength;
        do {
            $encodedByte = $x % 128;
            $x = (int) ($x / 128);
            if ($x > 0) {
                $encodedByte |= 128;
            }

            $stream->writeByte($encodedByte);
        } while ($x > 0);
    }
private function writeRemainingLength(PacketStream $stream)
    {
        $x = $this->remainingPacketLength;
        do {
            $encodedByte = $x % 128;
            $x = (int) ($x / 128);
            if ($x > 0) {
                $encodedByte |= 128;
            }

            $stream->writeByte($encodedByte);
        } while ($x > 0);
    }
private function writeRemainingLength ( PacketStream $ stream ) { $ x = $ this -> remainingPacketLength ; do { $ encodedByte = $ x % 128 ; $ x = ( int ) ( $ x / 128 ) ; if ( $ x > 0 ) { $ encodedByte |= 128 ; } $ stream -> writeByte ( $ encodedByte ) ; } while ( $ x > 0 ) ; }
Writes the remaining length to the given stream.

@param PacketStream $stream
Writes the remaining length to the given stream .