/**
  * @param $n
  * @return string
  * @throws RuntimeException
  * @throws PhpAmqpLib_Exception_AMQPRuntimeException
  */
 protected function rawread($n)
 {
     if ($this->io) {
         $this->wait();
         $res = $this->io->read($n);
         $this->offset += $n;
     } else {
         if ($this->str_length < $n) {
             throw new PhpAmqpLib_Exception_AMQPRuntimeException(sprintf('Error reading data. Requested %s bytes while string buffer has only %s', $n, $this->str_length));
         }
         $res = mb_substr($this->str, 0, $n, 'ASCII');
         $this->str = mb_substr($this->str, $n, mb_strlen($this->str, 'ASCII') - $n, 'ASCII');
         $this->str_length -= $n;
         $this->offset += $n;
     }
     return $res;
 }
 /**
  * @return PhpAmqpLib_Wire_IO_SocketIO
  */
 public function getSocket()
 {
     return $this->io->getSocket();
 }