Return next unformatted "line". If format is given, unpack content,
        otherwise return byte string.
765676
def readline(self, fmt=None):
        
        prefix_size = self._fix()

        if fmt is None:
            content = self.read(prefix_size)
        else:
            fmt = self.endian + fmt
            fmt = _replace_star(fmt, prefix_size)
            content = struct.unpack(fmt, self.read(prefix_size))

        try:
            suffix_size = self._fix()
        except EOFError:
            # when endian is invalid and prefix_size > total file size
            suffix_size = -1

        if prefix_size != suffix_size:
            raise IOError(_FIX_ERROR)

        return content
726942
public String getNextLine() {
		if (!isNextLine()) {
			return null;
		}
		if (isTag(nextLine))
			return FlatFileUtils.trimRight(nextLine,
					getTagWidth(nextLine));
		else
			return nextLine.trim();
	}
1156669
def read(self, source, compressed=False, encoding='UTF-8'):
        
        buf = ''
        for block in self.cat(source, compressed=compressed, encoding=encoding):
            buf += block
            if '\n' in buf:
                ret, buf = buf.rsplit('\n', 1)
                for line in ret.split('\n'):
                    yield line

        lines = buf.split('\n')
        for line in lines[:-1]:
            yield line

        # only yield the last line if the line has content in it
        if lines[-1]:
            yield lines[-1]
417516
async def readline(self) -> bytes:
        """"""
        if self._at_eof:
            return b''

        if self._unread:
            line = self._unread.popleft()
        else:
            line = await self._content.readline()

        if line.startswith(self._boundary):
            # the very last boundary may not come with \r\n,
            # so set single rules for everyone
            sline = line.rstrip(b'\r\n')
            boundary = self._boundary
            last_boundary = self._boundary + b'--'
            # ensure that we read exactly the boundary, not something alike
            if sline == boundary or sline == last_boundary:
                self._at_eof = True
                self._unread.append(line)
                return b''
        else:
            next_line = await self._content.readline()
            if next_line.startswith(self._boundary):
                # strip newline but only once
                line = line[:-len(self._newline)]
            self._unread.append(next_line)

        return line
507474
def readline(self, size=-1):
        ""
        while True:
            try:
                record = next(self.reader)
            except StopIteration:
                break

            # Ensure this is a valid record
            if checks.record_is_valid(record):
                if self.use_cache:
                    # Ensures the cache is updated and available
                    self.variants.ensure_cache(record)

                # Calculate the MD5 of the variant itself (not the record)
                md5 = calculate_md5(record)

                # Ensure this variant is not already loaded
                if not self.use_cache or md5 not in self.variants:
                    cleaned = self.process_line(record)
                    cleaned.append(md5)
                    return self.outdel.join(cleaned) + '\n'

        return ''
877535
private boolean readNextLine() throws IOException {
        boolean newLine = false;
        if (bufferLimit > 0 && !bufferLineEnd) {
            // check for "last line"
            if (bufferLimit < buffer.length) {
                return false;
            }
        } else {
            newLine = true;
        }

        bufferLineEnd = false;

        int off = 0;
        char[] b = new char[1];
        while (off < buffer.length && reader.read(b, 0, 1) > 0) {
            final char ch = b[0];
            buffer[off] = ch;
            ++off;
            if (ch == '\n') {
                bufferLineEnd = true;
                break;
            }
        }
        if (off > 0) {
            if (newLine) {
                ++lineNo;
                linePos = 0;
            }
            if (off < buffer.length) {
                buffer[off] = 0;
            }
            bufferOffset = -1;
            bufferLimit = off;
            return true;
        }
        return false;
    }
508483
def readline(self, size=-1):
        ""
        try:
            record = next(self.reader)
            return self.outdel.join(self.process_line(record)) + '\n'
        except StopIteration:
            return ''
799925
def skipline(self):
        
        position = self.tell()
        prefix = self._fix()
        self.seek(prefix, 1)  # skip content
        suffix = self._fix()

        if prefix != suffix:
            raise IOError(_FIX_ERROR)

        return position, prefix
1236534
def readline(self):
        """"""
        line = self.fd.__class__.readline(self.fd)
        if isinstance(line, bytes):
            line = line.decode()
        return line
649271
def readline(self, size=-1):
        
        remainder = int(self.length) - self.__position
        if size < 0 or size > remainder:
            size = remainder

        if size == 0:
            return EMPTY

        received = 0
        data = StringIO()
        while received < size:
            chunk_data = self.readchunk()
            pos = chunk_data.find(NEWLN, 0, size)
            if pos != -1:
                size = received + pos + 1

            received += len(chunk_data)
            data.write(chunk_data)
            if pos != -1:
                break

        self.__position -= received - size

        # Return 'size' bytes and store the rest.
        data.seek(size)
        self.__buffer = data.read()
        data.seek(0)
        return data.read(size)
512074
def _readline(self):
        
        if len(self.lines) > 1:
            return self.lines.pop(0)

        tail = ''
        if len(self.lines):
            tail = self.lines.pop()

        try:
            tail += self._read()
        except socket.error:
            logging.exception('No new data')
            time.sleep(0.1)

        self.lines += linesepx.split(tail)
        if len(self.lines) > 1:
            return self.lines.pop(0)
232560
def readline(self, size=None):
        """"""

# TODO: Add support for Unicode.
        (line, nl) = self.__buffer.read_until_nl(self.__retrieve_data)

        if self.__sf.access_type_has_universal_nl and nl is not None:
            self.__newlines[nl] = True

        return line
307863
@Nonnull
    public String getLine() {
        if (preLoaded) {
            if (bufferOffset >= 0) {
                int lineStart = bufferOffset;
                if (linePos > 0) {
                    lineStart -= linePos - 1;
                }
                int lineEnd = bufferOffset;
                while (lineEnd < bufferLimit && buffer[lineEnd] != '\n') {
                    ++lineEnd;
                }
                return new String(buffer, lineStart, lineEnd - lineStart);
            }
        } else if (bufferLimit > 0) {
            if (Math.abs((linePos - 1) - bufferOffset) < 2) {
                // only return the line if the line has not been consolidated before the
                // exception. This should avoid showing a bad exception line pointing to
                // the wrong content. This should never be the case in pretty-printed
                // JSON unless some really really long strings are causing the error.
                //
                // Since linePos does not exactly follow offset, we must accept +- 1.
                return new String(buffer, 0, bufferLimit - (bufferLineEnd ? 1 : 0));
            }
        }

        // Otherwise we don't have the requested line, return empty string.
        return "";
    }
1073719
def readline(self, size=None):
        
        data = EMPTY

        if size == 0:
            return data

        while True:
            if size and len(data) >= size:
                return data

            if not self.buffer:
                self._fetch()
                if not self.buffer:
                    # EOF
                    return data

            newline_pos = self.buffer.find(LF)
            if size:
                if newline_pos == -1:
                    remaining = size - len(data)
                    data += self.buffer[:remaining]
                    self.buffer = self.buffer[remaining:]
                else:
                    remaining = min(size - len(data), newline_pos)
                    data += self.buffer[:remaining]
                    self.buffer = self.buffer[remaining:]
            else:
                if newline_pos == -1:
                    data += self.buffer
                    self.buffer = EMPTY
                else:
                    data += self.buffer[:newline_pos]
                    self.buffer = self.buffer[newline_pos:]
104936
def _read_next(cls, lines: List[str]) -> 'FilePatch':
        
        # keep munching lines until we hit one starting with '---'
        while True:
            if not lines:
                raise Exception("illegal file patch format: couldn't find line starting with '---'")
            line = lines[0]
            if line.startswith('---'):
                break
            lines.pop(0)

        assert lines[0].startswith('---')
        assert lines[1].startswith('+++')
        old_fn = lines.pop(0)[4:].strip()
        new_fn = lines.pop(0)[4:].strip()

        hunks = []
        while lines:
            if not lines[0].startswith('@@'):
                break
            hunks.append(Hunk._read_next(lines))

        return FilePatch(old_fn, new_fn, hunks)
1095906
def _iter_unfolded_lines(self):
        """"""
        line = self._input_file.readline()
        while line:
            self.line_counter += 1
            self.byte_counter += len(line)

            line = self._strip_line_sep(line)

            nextline = self._input_file.readline()
            while nextline and nextline[:1] == b' ':
                line += self._strip_line_sep(nextline)[1:]
                nextline = self._input_file.readline()

            if not line.startswith(b'#'):
                yield line
            line = nextline
280159
def readline(self, size=-1):
        ""
        line = self.fin.readline()
        if not line:
            return ''
        return self.process_line(line.rstrip('\n'))