Read
@return char
11398
protected function Read()
	{
		$ch;
		if ( count( $this->m_buffer ) > 0 )
		{
		    $ch = array_shift( $this->m_buffer );
		}
		else
		{
		    $c = $this->m_reader->read();
		    if ( $c == -1 )
		        return '\0';
		    else
		        $ch = $c;
		}
		if ( $ch != '\r' )
		{
		    if ( $ch == '\n' )
		    {
		        $this->LineNo++;
		        $this->ColNo = 1;
		    }
		    else
		        ++$this->ColNo;
		}
		$this->m_position++;
		return $ch;
	}
342023
public function read()
    {
        $identity = $this->identity;

        if (null === $identity) {
            $identity = parent::read();

            $this->identity = $identity;
        }

        return $identity;
    }
850899
public Object read() {
    preRead();
    String curData = null;
    try {
      curData = reader.readLine();
    } catch (IOException e1) {
      logger.error(curData, e1);
    }
    indexInCsv++;
    if (null == curData) {
      return null;
    } else {
      return Strings.split(curData, ",");
    }
  }
675018
private function read()
    {
        $s = null;

        for (; !feof($this->sock);) {
            if (($line = fgets($this->sock, 1e3)) == null) {
                continue;
            }

            $s = explode(' ', $line)[0];

            if (preg_match('#^[0-9]+$#', $s)) {
                break;
            }
        }

        return (int) $s;
    }
1174362
public function peek() {
        if (($this->char + 1) <= $this->EOF) {
            return $this->data[$this->char + 1];
        }

        return false;
    }
395234
@Override
    public int read() throws IOException {
        int nextChar = super.read();

        // process the character
        if ( nextChar != -1 ) {
            if ( nextChar == '\n' ) {
                m_line++;
                pushColumn( m_column );
                m_column = 0;
            }
            else if ( nextChar == '\r') {
                int aheadChar = super.read();

                // if the lookahead is not a newline combo, unread it
                if ( aheadChar != '\n' ) {
                    // no need to unread it with line/offset update.
                    unreadImpl( aheadChar, false );
                }

                m_line++;
                pushColumn( m_column );
                m_column = 0;

                // normalize
                nextChar = '\n';
            } else {
                m_column++;
            }
            m_consumed++;
        }

        return nextChar;
    }
1311418
public function read()
    {
        $configuration = new Configuration();

        $options = [
            'focus' => [$configuration, 'setFocusPattern'],
            'skip' => [$configuration, 'setSkipPattern'],
            'grep' => [$configuration, 'setGrep'],
            'no-colors' => [$configuration, 'disableColors'],
            'force-colors' => [$configuration, 'enableColorsExplicit'],
            'bail' => [$configuration, 'stopOnFailure'],
            'configuration' => [$configuration, 'setConfigurationFile']
        ];

        if ($path = $this->input->getArgument('path')) {
            $configuration->setPath($path);
        }

        foreach ($options as $option => $callable) {
            $this->callForOption($option, $callable);
        }

        return $configuration;
    }
530065
public String readString () {
		if (!readVarIntFlag()) return readAsciiString(); // ASCII.
		// Null, empty, or UTF8.
		int charCount = readVarIntFlag(true);
		switch (charCount) {
		case 0:
			return null;
		case 1:
			return "";
		}
		charCount--;
		readUtf8Chars(charCount);
		return new String(chars, 0, charCount);
	}
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;
    }
746631
public String read() {
    if (mode.isReadable() == false)
      throw new IllegalStateException("IOError: not opened for reading");

    StringBuilder sb = new StringBuilder();
    try {
      BufferedReader reader = new BufferedReader(new FileReader(file));
      char[] buf = new char[1024];
      int numOfChars = 0;
      while ((numOfChars = reader.read(buf)) != -1) {
        sb.append(String.valueOf(buf, 0, numOfChars));
      }
      reader.close();
    } catch (IOException e) {
      logger.log(Level.SEVERE, null, e);
      throw new RuntimeException(e);
    }
    return sb.toString();
  }
162917
public function read()
    {

        // if file is readable
        if ($this->readable !== true) return false;

        if (!empty($this->fp) && is_resource($this->fp)) fclose($this->fp);

        $this->open_fp('r');

        if (filesize($this->file) == 0) return false;
        $this->lock(LOCK_SH);

        $content = (string)fread($this->fp, ($this->size >= 0) ? $this->size : 1);

        $this->lock(LOCK_UN);

        return $content;
    }
24280
protected function read() {
        while ($this->currentPosition < $this->codeLength) {
            $startPosition = $this->currentPosition;
            $currentChar = $this->code{$this->currentPosition};
            if (in_array($currentChar, $this->whitespaces)) {
                $this->readWhitespace();
            } else {
                switch ($currentChar) {
                    case '/': {
                        $this->readSlash();
                        break;
                    }
                    case '#': {
                        $this->readDirective();
                        break;
                    }
                    case '"': {
                        $this->readString();
                        break;
                    }
                }
            }

            // Force any progress in the loop
            if ($this->currentPosition === $startPosition) {
                $this->compressedCode .= $currentChar;
                ++$this->currentPosition;
            }
        }
    }
94373
public function read()
        {
            // Ignore first byte, I hope Socket.io does not send fragmented frames, so we don't have to deal with FIN bit.
            // There are also reserved bit's which are 0 in socket.io, and opcode, which is always "text frame" in Socket.io
            fread($this->fd, 1);

            // There is also masking bit, as MSB, but it's 0 in current Socket.io
            $payload_len = ord(fread($this->fd, 1));

            switch ($payload_len) {
                case 126:
                    $payload_len = unpack("n", fread($this->fd, 2));
                    $payload_len = $payload_len[1];
                    break;
                case 127:
                    $this->stdout('error', "Next 8 bytes are 64bit uint payload length, not yet implemented, since PHP can't handle 64bit longs!");
                    break;
            }

            // Use buffering to handle packet size > 16Kb
            $read       = 0;
            $payload    = '';

            while ($read < $payload_len && ($buff = fread($this->fd, $payload_len - $read))) {
                $read += strlen($buff);
                $payload .= $buff;
            }

            $this->stdout('debug', 'Received ' . $payload);

            return $payload;
        }
1289711
public function read()
    {
        if ($this->_canReadline) {
            $line = readline('');
            if (strlen($line) > 0) {
                readline_add_history($line);
            }

            return $line;
        }

        return fgets($this->_input);
    }
263908
public function read($length = null) {
		if (isset($length)) {
			return substr($this->str, 0, $length);
		}
		return $this->str;	
	}
1025498
protected static function read($bare = false) 
    {
        $delim = $bare ? "\n" : "\x04";
       
        for($buffer = '';($char = fgetc(self::$socket)) != $delim;$buffer .= $char);
       
        return trim($buffer);
    }
926092
public function read()
    {
        // First, read headers only
        $response = '';
        $gotStatus = false;

        while (($line = @fgets($this->socket)) !== false) {
            $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
            if ($gotStatus) {
                $response .= $line;
                if (rtrim($line) === '') break;
            }
        }

        $this->_checkSocketReadTimeout();

        $statusCode = Zend_Http_Response::extractCode($response);

        // Handle 100 and 101 responses internally by restarting the read again
        if ($statusCode == 100 || $statusCode == 101) return $this->read();

        // Check headers to see what kind of connection / transfer encoding we have
        $headers = Zend_Http_Response::extractHeaders($response);

        /**
         * Responses to HEAD requests and 204 or 304 responses are not expected
         * to have a body - stop reading here
         */
        if ($statusCode == 304 || $statusCode == 204 ||
            $this->method == Zend_Http_Client::HEAD) {

            // Close the connection if requested to do so by the server
            if (isset($headers['connection']) && $headers['connection'] == 'close') {
                $this->close();
            }
            return $response;
        }

        // If we got a 'transfer-encoding: chunked' header
        if (isset($headers['transfer-encoding'])) {

            if (strtolower($headers['transfer-encoding']) == 'chunked') {

                do {
                    $line  = @fgets($this->socket);
                    $this->_checkSocketReadTimeout();

                    $chunk = $line;

                    // Figure out the next chunk size
                    $chunksize = trim($line);
                    if (! ctype_xdigit($chunksize)) {
                        $this->close();

                        throw new Zend_Http_Client_Adapter_Exception('Invalid chunk size "' .
                            $chunksize . '" unable to read chunked body');
                    }

                    // Convert the hexadecimal value to plain integer
                    $chunksize = hexdec($chunksize);

                    // Read next chunk
                    $read_to = ftell($this->socket) + $chunksize;

                    do {
                        $current_pos = ftell($this->socket);
                        if ($current_pos >= $read_to) break;

                        if($this->out_stream) {
                            if(stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
                              $this->_checkSocketReadTimeout();
                              break;
                             }
                        } else {
                            $line = @fread($this->socket, $read_to - $current_pos);
                            if ($line === false || strlen($line) === 0) {
                                $this->_checkSocketReadTimeout();
                                break;
                            }
                                    $chunk .= $line;
                        }
                    } while (! feof($this->socket));

                    $chunk .= @fgets($this->socket);
                    $this->_checkSocketReadTimeout();

                    if(!$this->out_stream) {
                        $response .= $chunk;
                    }
                } while ($chunksize > 0);
            } else {
                $this->close();

                throw new Zend_Http_Client_Adapter_Exception('Cannot handle "' .
                    $headers['transfer-encoding'] . '" transfer encoding');
            }

            // We automatically decode chunked-messages when writing to a stream
            // this means we have to disallow the Zend_Http_Response to do it again
            if ($this->out_stream) {
                $response = str_ireplace("Transfer-Encoding: chunked\r\n", '', $response);
            }
        // Else, if we got the content-length header, read this number of bytes
        } elseif (isset($headers['content-length'])) {

            // If we got more than one Content-Length header (see ZF-9404) use
            // the last value sent
            if (is_array($headers['content-length'])) {
                $contentLength = $headers['content-length'][count($headers['content-length']) - 1];
            } else {
                $contentLength = $headers['content-length'];
            }

            $current_pos = ftell($this->socket);
            $chunk = '';

            for ($read_to = $current_pos + $contentLength;
                 $read_to > $current_pos;
                 $current_pos = ftell($this->socket)) {

                 if($this->out_stream) {
                     if(@stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
                          $this->_checkSocketReadTimeout();
                          break;
                     }
                 } else {
                    $chunk = @fread($this->socket, $read_to - $current_pos);
                    if ($chunk === false || strlen($chunk) === 0) {
                        $this->_checkSocketReadTimeout();
                        break;
                    }

                    $response .= $chunk;
                }

                // Break if the connection ended prematurely
                if (feof($this->socket)) break;
            }

        // Fallback: just read the response until EOF
        } else {

            do {
                if($this->out_stream) {
                    if(@stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
                          $this->_checkSocketReadTimeout();
                          break;
                     }
                }  else {
                    $buff = @fread($this->socket, 8192);
                    if ($buff === false || strlen($buff) === 0) {
                        $this->_checkSocketReadTimeout();
                        break;
                    } else {
                        $response .= $buff;
                    }
                }

            } while (feof($this->socket) === false);

            $this->close();
        }

        // Close the connection if requested to do so by the server
        if (isset($headers['connection']) && $headers['connection'] == 'close') {
            $this->close();
        }

        return $response;
    }