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