Read one line (not contains \r\n at the end)
@return mixed line string, null when has not data, or false on error.
329506
public function getLine()
    {
        $line = @stream_get_line($this->sock, 2048, "\n");
        if ($line === '' || $line === false) {
            $line = $this->ioEmptyError() ? false : null;
        } else {
            $line = rtrim($line, "\r");
        }
        $this->ioFlagReset();
        return $line;
    }
407156
@Override
    public int read() throws IOException {
        if (newLineWasRead) {
            line += 1;
            column = 1;
            newLineWasRead = false;
        }

        int charRead = super.read();
        if (charRead > -1) {
            char c = (char)charRead;
            // found a \r or \n, like on Mac or Unix
            // could also be Windows' \r\n
            if (c == '\r' || c == '\n') {
                newLineWasRead = true;
                if (c == '\r') {
                    mark(1);
                    c = (char)super.read();
                    // check if we have \r\n like on Windows
                    // if it's not \r\n we reset, otherwise, the \n is just consummed
                    if (c != '\n') {
                        reset();
                    }
                }
            } else {
                column += 1;
            }
        }

        return charRead;
    }
960041
protected function GetLine()
    {
        $sLine = fgets($this->fp, 2048 * 16);
        if (false === $sLine) {
            return $sLine;
        }
        // find out if the line contains an uneven number of '"'. if so, we assume, that the line contains a line break
        $sLine = trim($sLine);
        $aTmpParts = explode('"', $sLine);
        if (1 != (count($aTmpParts) % 2)) {
            // need to read until we find the first '"'...
            $bDone = false;
            do {
                $sTmpLine = fgets($this->fp, 2048 * 16);
                if (false === $sTmpLine) {
                    $bDone = true;
                } else {
                    $sTmpLine = trim($sTmpLine);
                    $sLine .= "\n".$sTmpLine;
                    $aTmpParts = explode('"', $sTmpLine);
                    if (1 != (count($aTmpParts) % 2)) {
                        $bDone = true;
                    }
                }
            } while (!$bDone);
        }
        $sLine = utf8_encode($sLine);
        $aParts = explode($this->sLineSplit, $sLine);

        // strip quotes
        foreach (array_keys($aParts) as $sIndex) {
            $aParts[$sIndex] = trim($aParts[$sIndex]);
            if ('"' == substr($aParts[$sIndex], 0, 1) && '"' == substr($aParts[$sIndex], -1)) {
                $aParts[$sIndex] = substr($aParts[$sIndex], 1, -1);
            }
        }
        reset($aParts);

        return $aParts;
    }
651484
public function getLine($length = null)
    {
        if (!$this->handle) $this->open('r');
        if ($length === null) return $this->fs->fgets($this->handle);
        else return $this->fs->fgets($this->handle, $length);
    }
655334
public final String getNextLine() throws IOException {
    String str = null;
    if (buf_end - buf_pos <= 0) {
      if (fillBuffer() < 0) {
        return null;
      }
    }
    int lineend = -1;
    for (int i = buf_pos; i < buf_end; i++) {
      if (buffer[i] == '\n') {
        lineend = i;
        break;
      }
      // check for only '\r' as line end
      if ((i - buf_pos > 0) && buffer[i - 1] == '\r') {
        lineend = i - 1;
        break;
      }
    }
    if (lineend < 0) {
      StringBuilder input = new StringBuilder(256);
      int c;
      int lastC = 0;
      while (((c = read()) != -1) && (c != '\n') && (lastC != '\r')) {
        input.append((char) c);
        lastC = c;
      }
      if ((c == -1) && (input.length() == 0)) {
        return null;
      }
      return input.toString();
    }
    if (lineend > 0 && buffer[lineend] == '\n' && buffer[lineend - 1] == '\r') {
      str = new String(buffer, buf_pos, lineend - buf_pos - 1);
    } else {
      str = new String(buffer, buf_pos, lineend - buf_pos);
    }
    buf_pos = lineend + 1;
    return str;
  }
708558
private function peekLine()
    {
        if ($this->filePeek == null) {
            $this->filePeek = fgets($this->fileHandle);
        }

        return $this->filePeek;
    }
853532
public function read($n) {
    if ($n < 1) {
      return "";
    }

    $string = fread($this->f, $n);
    $chunks = str_split($string, 2);
    $chunks = array_map("strrev", $chunks);

    return implode("", $chunks);
  }
413503
protected function httpReadFirstline()
    {
        if (($l = $this->readline()) === null) {
            return null;
        }
        $e = explode(' ', $l);
        $u = isset($e[1]) ? parse_url($e[1]) : false;
        if ($u === false) {
            $this->badRequest();
            return false;
        }
        if (!isset($u['path'])) {
            $u['path'] = null;
        }
        if (isset($u['host'])) {
            $this->server['HTTP_HOST'] = $u['host'];
        }
        $srv = &$this->server;
        $srv['REQUEST_METHOD'] = $e[0];
        $srv['REQUEST_TIME'] = time();
        $srv['REQUEST_TIME_FLOAT'] = microtime(true);
        $srv['REQUEST_URI'] = $u['path'] . (isset($u['query']) ? '?' . $u['query'] : '');
        $srv['DOCUMENT_URI'] = $u['path'];
        $srv['PHP_SELF'] = $u['path'];
        $srv['QUERY_STRING'] = isset($u['query']) ? $u['query'] : null;
        $srv['SCRIPT_NAME'] = $srv['DOCUMENT_URI'] = isset($u['path']) ? $u['path'] : '/';
        $srv['SERVER_PROTOCOL'] = isset($e[2]) ? $e[2] : 'HTTP/1.1';
        $srv['REMOTE_ADDR'] = $this->addr;
        $srv['REMOTE_PORT'] = $this->port;
        return true;
    }
800392
private String readLine()
    {
        try
        {
            BufferedReader rin = new BufferedReader(new InputStreamReader(System.in));
            return rin.readLine();
        }
        catch (Exception e)
        {
            return "";
        }
    }
15012
public function getReadHandler()
    {
        if (null === $this->stream) {
            $this->stream = fopen($this->uri, 'r');
        }
        return $this->stream;
    }
112130
private function getLine():string
	{
		$line= fgets( $this->handle );

		$this->raw.= $line;

		return trim( $line );
	}
175189
public function readLine()
    {
        $out = $this->read();
        if ($this->withHeader && is_array($out)) {
            $out = array_combine($this->header, $out);
        }
        return $out;
    }
750716
protected function read()
    {
        $buffer = '';
        while (($line = fgets($this->_connection, 1000)) != null) { // intentionally ==
            $buffer .= $line;
            if (substr($line, 3, 1) === ' ') {
                break;
            }
        }
        return $buffer;
    }
600412
protected function readLine()
    {
        if ($this->line_number === 0)
        {
            $st = ftell($this->file_handle);
            if ($st === 0)
            { 
                // Attempt to read a Byte Order Mark only if this file handle is at the start of the file
                $utf8_bom = Encoding::getBOM('UTF8');
                $maybe_bom = fread($this->file_handle, 3);
                $this->has_bom = $utf8_bom === $maybe_bom;

                // Rewind if the first three characters are not the UTF8 BOM
                if (!$this->has_bom)
                    fseek($this->file_handle, 0);
            }
        }

        if ($this->read_header && empty($this->line_number) && $this->header === null)
            $this->header = fgetcsv($this->file_handle, 0, $this->delimiter, $this->enclosure, $this->escape_char);

        $line = fgetcsv($this->file_handle, 0, $this->delimiter, $this->enclosure, $this->escape_char);

        if ($line === false)
        {
            $this->current_line = false;
            return;
        }

        if ($this->header !== null)
        {
            $row = array();
            foreach ($line as $idx => $col)
            {
                $name = isset($this->header[$idx]) ? $this->header[$idx] : null;
                if ($name)
                    $row[$name] = $col;
                else
                    $row[] = $col;
            }
            $this->current_line = $row;
        }
        else
            $this->current_line = $line;
    }
518697
public function readStringNull()
    {
        $pos = \strpos($this->buffer, "\0", $this->bufferPos);
        if ($pos === false) {
            throw new \LogicException('Missing NULL character');
        }

        $ret = $this->read($pos - $this->bufferPos);
        ++$this->bufferPos;

        return $ret;
    }
986327
protected function readLine()
    {
        $buffer = '';

        while ($buffer === '') {
            if (($buffer = fgets($this->getFileHandler())) === false) {
                $this->currentLine = null;

                return;
            }
            $buffer = trim($buffer, "\n\r\0");

            if (!$this->skipEmptyLines) {
                break;
            }
        }

        $this->currentLine = $buffer;
    }
402472
public function readline($length=null) {
		$this->assertReadable();
		return $this->format->readline($this->file, $length);
	}