original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Reads the remaining length from the given stream.
  
  @param PacketStream $stream
  
  @throws MalformedPacketException
docstring_tokens: Reads the remaining length from the given stream .