[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Common/Traits/ -> ReadBytes.php (source)

   1  <?php
   2  
   3  /**
   4   * ReadBytes trait
   5   *
   6   * PHP version 5
   7   *
   8   * @category  System
   9   * @package   SSH
  10   * @author    Jim Wigginton <[email protected]>
  11   * @copyright 2015 Jim Wigginton
  12   * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
  13   * @link      http://phpseclib.sourceforge.net
  14   */
  15  
  16  namespace phpseclib3\System\SSH\Common\Traits;
  17  
  18  /**
  19   * ReadBytes trait
  20   *
  21   * @package SSH
  22   * @author  Jim Wigginton <[email protected]>
  23   * @access  public
  24   */
  25  trait ReadBytes
  26  {
  27      /**
  28       * Read data
  29       *
  30       * @param int $length
  31       * @throws \RuntimeException on connection errors
  32       * @access public
  33       */
  34      public function readBytes($length)
  35      {
  36          $temp = fread($this->fsock, $length);
  37          if (strlen($temp) != $length) {
  38              throw new \RuntimeException("Expected $length bytes; got " . strlen($temp));
  39          }
  40          return $temp;
  41      }
  42  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer