public function readLine($endOfLine = Server::EOL)
    {
        $this->ensureConnected();
        $buffer = '';

        do {
            $buffer .= $this->read(self::MAX_SINGLE_RESPONSE_LENGTH);

            $eolPosition = strpos($buffer, $endOfLine);
        } while ($eolPosition === false);

        $this->readBuffer = substr($buffer, $eolPosition + strlen($endOfLine));
        return substr($buffer, 0, $eolPosition + strlen($endOfLine));
    }