Reads a line up until \r\n This will act similar to
BufferedReader.readLine

@return The line
@throws IOException If an error occurs while reading
336421
public String readLine() throws IOException {
		StringBuilder bldr = new StringBuilder();
		while (true) {
			int b = read();
			if (b == -1 || b == 10) {
				break;
			} else if (b != '\r') {
				bldr.append((char) ((byte) b));
			}
		}
		return bldr.toString();
	}
84560
@Override
    public int readLine(byte[] b, int off, int len) throws IOException {
        
        //Return -1 here because if we are closed or finished, we're at the end of the stream
        if(isClosed || isFinished()){
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Nothing to read, stream is closed : " + isClosed + ", or finished : " + isFinished());
            return -1;
        }
        
        //We want to prevent readLine calls from going async since they can be unpredictable
        this.readLineCall =  true;
        
        int readLineReturn = super.readLine(b, off, len);
        
        this.readLineCall = false;
        
        return readLineReturn;
    }
1099325
def readline(self, limit=-1):
        """"""
        if limit != -1:
            raise NotImplementedError('limits other than -1 not implemented yet')
        the_line = io.BytesIO()
        while not (self._eof and len(self._buffer) == 0):
            #
            # In the worst case, we're reading the unread part of self._buffer
            # twice here, once in the if condition and once when calling index.
            #
            # This is sub-optimal, but better than the alternative: wrapping
            # .index in a try..except, because that is slower.
            #
            remaining_buffer = self._buffer.peek()
            if self._line_terminator in remaining_buffer:
                next_newline = remaining_buffer.index(self._line_terminator)
                the_line.write(self._read_from_buffer(next_newline + 1))
                break
            else:
                the_line.write(self._read_from_buffer())
                self._fill_buffer()
        return the_line.getvalue()
837106
public String readLine() {
        while (!endReached) {
            if (charBuf == null) { //  || (charBuf.length() <= index)
                // Read next
                byteBuf.clear();
                int bytesRead;
                try {
                    bytesRead = fileChannel.read(byteBuf);
                } catch (IOException e) {
                    throw new BitsyException(BitsyErrorCodes.ERROR_READING_FROM_FILE, "File " + getPath() + " can not be opened for reading", e);
                }

                if (bytesRead == -1) {
                    // Done with reads
                    endReached = true;

                    break; // or continue, doesn't matter
                }

                // Get more chars into the buffer
                byteBuf.flip();
                
                charBuf = FileBackedMemoryGraphStore.utf8.decode(byteBuf);
                
                // Reset the index
                byteIndex = 0;
                index = 0;
            }

            // Find where the \n is
            int cbLen = charBuf.length(); 
            int oldIndex = index;
            for (; index < cbLen; index++, byteIndex++) {
                char ch = charBuf.charAt(index);
                
                // Handling UTF-8 characters. byteIndex is used for truncation
                if (((int)ch & mask2) != 0) {
                    byteIndex ++;
                }
                
                if (((int)ch & mask3) != 0) {
                    byteIndex ++;
                }
                
                if (ch == '\n') {
                    break; // out of the for loop                        
                }
            }

            // Add what was found (or till end) to the current line
            CharBuffer partialLine = charBuf.subSequence(oldIndex, index);
            
            // Did we reach the end of the buffer?
            if (index < cbLen) {
                // Skip the \n next time
                index++;
                byteIndex++;
                
                if (curLine.length() == 0) {
                    // Common case
                    return partialLine.toString();
                } else {
                    curLine.append(partialLine);

                    // Exit the while-loop and return curLine
                    break;
                }
            } else {
                // Reached end of buffer. Continue reading to the charBuf
                charBuf = null;

                // But add what was found to curLine
                curLine.append(partialLine);
            }
        }

        // Return what is left in the string buffer
        if (endReached && curLine.length() == 0) {
            return null;
        } else {
            String ans = curLine.toString();
            curLine.setLength(0);
            return ans;
        }
    }
253828
@Override
    public String readLine() throws IOException {
        StringBuilder lineBuilder = new StringBuilder();
        EditorOperation operation;
        while (true) {
            operation = readOperation();
            switch (operation.getType()) {
                case BACKSAPCE:
                case DELETE:
                    if (lineBuilder.length() > 0) {
                        lineBuilder.delete(lineBuilder.length() - 1, lineBuilder.length());
                        console.out().print(Ansi.ansi().cursorLeft(1));
                        console.out().print(" ");
                        console.out().print(Ansi.ansi().cursorLeft(1));
                    }
                    break;
                case NEWLINE:
                    return lineBuilder.toString();
                case TYPE:
                    console.out().print(operation.getInput());
                    lineBuilder.append(operation.getInput());
                    break;
            }
            flush();
        }
    }
203910
public static String readFile(File file) throws IOException {
        StringBuilder content = new StringBuilder();
        String line;
        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            while ((line = reader.readLine()) != null) {
                content.append(line).append("\r\n");
            }
        }
        return content.toString();
    }
1172631
public static int readLine(LineReader lineReader, Text out) 
  throws IOException {
    out.clear();
    return lineReader.readLine(out);
  }
431641
public String next() throws IOException {
        if (done) {
            return null;
        }
        for (;;) {
            if (line == null) {
                line = reader.readLineSkippingComments();
                if (line == null) {
                    done = true;
                    return null;
                }
                pos = 0;
            }
            buf.setLength(0);
            lastpos = pos;
            pos = nextToken(pos);
            if (pos < 0) {
                line = null;
                continue;
            }
            return buf.toString();
        }
    }
574686
public String read() throws IOException {
        StringWriter out = new StringWriter();
        PrintWriter w = new PrintWriter(out);
        try (BufferedReader in = Files.newBufferedReader(Util.fileToPath(file), StandardCharsets.UTF_8)) {
            String line;
            while ((line = in.readLine()) != null)
                w.println(line);
        } catch (Exception e) {
            throw new IOException("Failed to fully read " + file, e);
        }
        return out.toString();
    }
1122691
public byte[] readLine(int offset) throws IOException {
		int lastIndex = -1;
		int localOffset = offset;
		int read;
		do {
			read = ensureBuffer(localOffset, BUFFER_SIZE);
			if (read <= 0) {
				// EOF
				this.pos = this.buffer.length;
				return null;
			}

			// NOT EOF, search for end of line
			final int end = localOffset + read;
			for (int idx = localOffset; (lastIndex == -1) && (idx < this.buffer.length) && (idx < end); ++idx) {
				if ((this.buffer[idx] == '\n') || (this.buffer[idx] == '\r')) {
					lastIndex = idx;
				}
			}
			localOffset += read;
		}
		while (lastIndex == -1);
		this.pos = lastIndex;
		return Arrays.copyOfRange(this.buffer, offset, lastIndex);
	}
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;
    }
1151157
public int read() throws IOException {
    // Read the next non-whitespace character
    int x;
    do {
      x = in.read();
      if (x == -1) {
        return -1;
      }
    } while (Character.isWhitespace((char) x));
    charCount++;

    // The '=' sign is just padding
    if (x == '=') {
      return -1; // effective end of stream
    }

    // Convert from raw form to 6-bit form
    x = ints[x];

    // Calculate which character we're decoding now
    int mode = (charCount - 1) % 4;

    // First char save all six bits, go for another
    if (mode == 0) {
      carryOver = x & 63;
      return read();
    }
    // Second char use previous six bits and first two new bits,
    // save last four bits
    else if (mode == 1) {
      int decoded = ((carryOver << 2) + (x >> 4)) & 255;
      carryOver = x & 15;
      return decoded;
    }
    // Third char use previous four bits and first four new bits,
    // save last two bits
    else if (mode == 2) {
      int decoded = ((carryOver << 4) + (x >> 2)) & 255;
      carryOver = x & 3;
      return decoded;
    }
    // Fourth char use previous two bits and all six new bits
    else if (mode == 3) {
      int decoded = ((carryOver << 6) + x) & 255;
      return decoded;
    }
    return -1; // can't actually reach this line
  }
514417
public static String readOutput(BufferedReader in) throws IOException {
        StringBuffer output = new StringBuffer();
        String line = "";
        while ((line = in.readLine()) != null) {
            output.append(line);
            output.append("\n");
        }
        return output.toString();
    }
227505
public static int readLine(InputStream in,
                               OutputStream out) throws IOException {

        int count = 0;

        for (;;) {
            int b = in.read();

            if (b == -1) {
                break;
            }

            count++;

            out.write(b);

            if (b == '\n') {
                break;
            }
        }

        return count;
    }
323034
public int readLine(byte[] b,int off,int len)
        throws IOException
    {
        len=fillLine(len);

        if (len<0)
            return -1;
        if (len==0)
            return 0;
        
        System.arraycopy(_buf,_mark, b, off, len);
        _mark=-1;

        return len;
    }
524956
public String readLine() throws IOException {

        ensureOpen();

        StringBuilder sb = null;

        start = tempStart;

        firstRead = true;

        while (true) {

            tempLen = 0;
            ok = false;

            readString();
            // if (tempLen != 0)
            // System.out.println(new String(cb, tempOffe, tempLen));

            if (!isRead && (tempLen == 0 || len == 0)) {
                if (sb != null) {
                    return sb.toString();
                }
                return null;
            }

            if (!isRead) { // 如果不是需要读状态，那么返回
                tempStart += tempLen;
                if (sb == null) {
                    return new String(cb, tempOffe, tempLen);
                } else {
                    sb.append(cb, tempOffe, tempLen);
                    return sb.toString();
                }
            }

            if (tempLen == 0) {
                continue;
            }

            // 如果是需要读状态那么读取
            if (sb == null) {
                sb = new StringBuilder();
            }
            sb.append(cb, tempOffe, tempLen);
            tempStart += tempLen;
        }

    }
1039757
private int get() throws IOException {
        int c = theLookahead;
        theLookahead = EOF;
        if (c == EOF) {
            c = inputStream.read();
        }
        if (c >= ' ' || c == '\n' || c == EOF) {
            return c;
        }
        if (c == '\r') {
            return '\n';
        }
        return ' ';
    }