public function consumeReadBuffer(int $bytes) : string
    {
        if ($this->getBufferLength()<$bytes) {
            throw new \RuntimeException("BufferedSocket::getAndConsumeReadBuffer requested more bytes than are currently available. Requested=".$bytes.", available=".$this->getBufferLength().".");
        }
        $data = \substr($this->getReadBuffer(), 0, $bytes);
        $this->reduceReadBuffer($bytes);
        return $data;
    }