private function readRemainingLength(PacketStream $stream)
    {
        $this->remainingPacketLength = 0;
        $multiplier = 1;

        do {
            $encodedByte = $stream->readByte();

            $this->remainingPacketLength += ($encodedByte & 127) * $multiplier;
            $multiplier *= 128;

            if ($multiplier > 128 * 128 * 128 * 128) {
                throw new MalformedPacketException('Malformed remaining length.');
            }
        } while (($encodedByte & 128) !== 0);
    }
private function readRemainingLength(PacketStream $stream)
    {
        $this->remainingPacketLength = 0;
        $multiplier = 1;

        do {
            $encodedByte = $stream->readByte();

            $this->remainingPacketLength += ($encodedByte & 127) * $multiplier;
            $multiplier *= 128;

            if ($multiplier > 128 * 128 * 128 * 128) {
                throw new MalformedPacketException('Malformed remaining length.');
            }
        } while (($encodedByte & 128) !== 0);
    }
private function readRemainingLength ( PacketStream $ stream ) { $ this -> remainingPacketLength = 0 ; $ multiplier = 1 ; do { $ encodedByte = $ stream -> readByte ( ) ; $ this -> remainingPacketLength += ( $ encodedByte & 127 ) * $ multiplier ; $ multiplier *= 128 ; if ( $ multiplier > 128 * 128 * 128 * 128 ) { throw new MalformedPacketException ( 'Malformed remaining length.' ) ; } } while ( ( $ encodedByte & 128 ) !== 0 ) ; }
Reads the remaining length from the given stream.

@param PacketStream $stream

@throws MalformedPacketException
Reads the remaining length from the given stream .