function readLine()
    {
        $i = $this->pos;
        $tot_len = strlen($this->data);
        while ($i<$tot_len && !$this->isEndOfLine($i)) {
            $i++;
        }

        $result = substr($this->data,$this->pos,$i-$this->pos);
        $i++;   //skip first EOL char
        if ($this->getLineEndingModeCrlf()) $i++;  //skip second EOL char if needed
        $this->pos=$i;  //update position
        return $result;
    }