Reads the next record.

@return True if a record could be read, false otherwise.
166638
private boolean readNextRecord() throws IOException {
		boolean recordFound = false;
		while (!recordFound) {
			// no more records left
			if (numReadRecords >= numTotalRecords) {
				return false;
			}

			try {
				if (numReadRecords == numRecordsUpToCurrentBlock) {
					// advance to next block
					PageReadStore pages = reader.readNextRowGroup();
					recordReader = createRecordReader(pages);
					numRecordsUpToPreviousBlock = numRecordsUpToCurrentBlock;
					numRecordsUpToCurrentBlock += pages.getRowCount();
					currentBlock++;
				}

				numReadRecords++;
				try {
					readRecord = recordReader.read();
					readRecordReturned = false;
				} catch (RecordMaterializationException e) {
					String errorMessage = String.format(
						"skipping a corrupt record in block number [%d] record number [%s] of file %s",
						currentBlock, numReadRecords - numRecordsUpToPreviousBlock, reader.getFile());

					if (!skipCorruptedRecord) {
						LOG.error(errorMessage);
						throw e;
					} else {
						LOG.warn(errorMessage);
					}
					continue;
				}

				if (readRecord == null) {
					readRecordReturned = true;
					numReadRecords = numRecordsUpToCurrentBlock;
					LOG.debug("filtered record reader reached end of block");
					continue;
				}

				recordFound = true;
				LOG.debug("read value: {}", readRecord);
			} catch (RecordMaterializationException e) {
				LOG.error(String.format("Can not read value at %d in block %d in file %s",
					numReadRecords - numRecordsUpToPreviousBlock, currentBlock, reader.getFile()), e);
				if (!skipCorruptedRecord) {
					throw e;
				}
				return false;
			}
		}

		return true;
	}
445207
protected final boolean readLine() throws IOException {
		if (this.stream == null || this.overLimit) {
			return false;
		}

		int countInWrapBuffer = 0;

		/* position of matching positions in the delimiter byte array */
		int i = 0;

		while (true) {
			if (this.readPos >= this.limit) {
				if (!fillBuffer()) {
					if (countInWrapBuffer > 0) {
						setResult(this.wrapBuffer, 0, countInWrapBuffer);
						return true;
					} else {
						return false;
					}
				}
			}

			int startPos = this.readPos;
			int count = 0;

			while (this.readPos < this.limit && i < this.delimiter.length) {
				if ((this.readBuffer[this.readPos++]) == this.delimiter[i]) {
					i++;
				} else {
					i = 0;
				}

			}

			// check why we dropped out
			if (i == this.delimiter.length) {
				// line end
				count = this.readPos - startPos - this.delimiter.length;

				// copy to byte array
				if (countInWrapBuffer > 0) {
					// check wrap buffer size
					if (this.wrapBuffer.length < countInWrapBuffer + count) {
						final byte[] nb = new byte[countInWrapBuffer + count];
						System.arraycopy(this.wrapBuffer, 0, nb, 0, countInWrapBuffer);
						this.wrapBuffer = nb;
					}
					if (count >= 0) {
						System.arraycopy(this.readBuffer, 0, this.wrapBuffer, countInWrapBuffer, count);
					}
					setResult(this.wrapBuffer, 0, countInWrapBuffer + count);
					return true;
				} else {
					setResult(this.readBuffer, startPos, count);
					return true;
				}
			} else {
				count = this.limit - startPos;
				
				// check against the maximum record length
				if ( ((long) countInWrapBuffer) + count > this.lineLengthLimit) {
					throw new IOException("The record length exceeded the maximum record length (" + 
							this.lineLengthLimit + ").");
				}

				// buffer exhausted
				if (this.wrapBuffer.length - countInWrapBuffer < count) {
					// reallocate
					byte[] tmp = new byte[Math.max(this.wrapBuffer.length * 2, countInWrapBuffer + count)];
					System.arraycopy(this.wrapBuffer, 0, tmp, 0, countInWrapBuffer);
					this.wrapBuffer = tmp;
				}

				System.arraycopy(this.readBuffer, startPos, this.wrapBuffer, countInWrapBuffer, count);
				countInWrapBuffer += count;
			}
		}
	}
169944
@Override
	public boolean next() {
		if (isLhsEmpty)
			return false;
		if (s2.next())
			return true;
		else if (!(isLhsEmpty = !s1.next())) {
			s2.beforeFirst();
			return s2.next();
		} else {
			return false;
		}
	}
495041
@Override
	public BasicLogRecord next() {
		if (!isForward) {
			currentRec = currentRec - pointerSize;
			isForward = true;
		}
		if (currentRec == 0)
			moveToNextBlock();
		currentRec = (Integer) pg.getVal(currentRec, INTEGER).asJavaVal();
		return new BasicLogRecord(pg, new LogSeqNum(blk.number(), currentRec + pointerSize * 2));
	}
739799
public boolean doHasNext() throws DBException
    {
        if ((m_iRecordStatus & DBConstants.RECORD_AT_EOF) != 0)
            return false; // Already at EOF, can't be one after
        if ((m_iRecordStatus & DBConstants.RECORD_NEXT_PENDING) != 0)
            return true;    // Already one waiting
        boolean bAtEOF = true;
        if (!this.isOpen())
            this.open();    // Make sure any listeners are called before disabling.
        Object[] rgobjEnabledFields = this.getRecord().setEnableNonFilter(null, false, false, false, false, true);
        FieldList record = null;
        try {
            record = this.move(DBConstants.NEXT_RECORD);
            if (record == null)
                bAtEOF = true;
            else if ((m_iRecordStatus & DBConstants.RECORD_AT_EOF) != 0)
                bAtEOF = true;
            else if (this.isTable())
                bAtEOF = this.isEOF();
            else
                bAtEOF = false;     // Valid record!
        } catch (DBException ex) {
            throw ex;
        } finally {
            this.getRecord().setEnableNonFilter(rgobjEnabledFields, false, false, false, bAtEOF, true);
        }
        if (bAtEOF)
            return false; // Does not have a next record
        m_iRecordStatus |= DBConstants.RECORD_NEXT_PENDING;     // If next call is a moveNext(), return unchanged!
        return true;        // Yes, a next record exists.
    }
833566
public boolean next() throws IOException {
		boolean hasNext = true;
		try {
			pageId = stream.readInt();
			pageNamespace = stream.readInt();
			pageTitle = stream.readUTFAsArray();
			pageIsRedirect = stream.readBoolean();
		} catch (EOFException e) {
			hasNext = false;
		}
		return hasNext;
	}
683515
private boolean setPositionByMin() {
		// min always points to a start of a record
		long min = getPosition();
		if (min < 0) {
			return false;
		}
		try {
			long max = reader.length();
			int recSize = reader.readLength();
			if (recSize < 0 || min + recSize + 8 > max) {
				// Even first record is incomplete
				return false;
			}
			DataInputStream input = readRecord(recSize);
			if (LogRecordSerializer.RECORD != formatter.getType(input)) {
				// First record is not a record
				return false;
			}
			RepositoryLogRecordImpl record = formatter.deserializeLogTime(input);
			// First record already satisfies condition
			if (verifyMin(record)) {
				return true;
			}
			reader.seek(max);
			long nextPosition = seekToPrevRecord(formatter);
			max = nextPosition;
			
			do {
				recSize = reader.readLength();
				if (recSize < 0 || nextPosition + recSize + 8 > max) {
					// corrupt record, good records are closer to the start.
					max = nextPosition;
				} else {
					input = readRecord(recSize);
					if (LogRecordSerializer.RECORD != formatter.getType(input)) {
						// Got all the way to the header record.
						max = nextPosition;
					} else {
						record =  formatter.deserializeLogTime(input);
						if (verifyMin(record)) {
							max = nextPosition;
						} else {
							min = nextPosition + recSize + 8;
						}
					}
				}
				reader.seek((min + max)/2);
				nextPosition = seekToNextRecord(formatter);
				// loop until seek to next record returns us back to max.
			} while (nextPosition < max);
			return true;
		} catch (IOException ex) {
			logger.logp(Level.SEVERE, className, "setPositionBySeq", "Error to set position in {0} by min condition: ", new Object[]{file, ex.getMessage()});
			logger.logp(Level.SEVERE, className, "setPositionBySeq", ex.getLocalizedMessage(), ex);
			// Fall through to return false.
		} finally {
			try {
				reader.seek(min);
			} catch (IOException ex) {
				// too late to fix, allow reading logic to work around it.
				// don't use return here it would mask all uncaught exceptions
			}
		}
		
		return false;
	}
149899
@Override
    public Record nextRecord() {
        List<Writable> next = next();
        URI uri = (locations == null || locations.length < 1 ? null : locations[splitIndex]);
        RecordMetaData meta = new RecordMetaDataLine(this.lineIndex - 1, uri, SVMLightRecordReader.class); //-1 as line number has been incremented already...
        return new org.datavec.api.records.impl.Record(next, meta);
    }
561827
public final boolean read() {
    Object[] curData = (Object[]) reader.read();
    if (null == curData) {
      setCurrent(null);
      setCurData(null);
      return false;
    } else {
      values.clear();
      for (int i = 0; i < curData.length; i++) {
        values.put(attrs[i], curData[i]);
      }
      return true;
    }
  }
439194
public DBaseFileRecord readNextDBFRecord() throws IOException {
		if (this.recordCount == -1) {
			throw new MustCallReadHeaderFunctionException();
		}
		if (this.readingPosition >= this.recordCount) {
			return null;
		}

		try {
			// Update the readingPosition attribute AFTER the call to the
			// reading function to avoid invalid usage of its value
			// by this function.
			final DBaseFileRecord record = readDBFRecord(this.readingPosition);
			++this.readingPosition;
			return record;
		} catch (EOFException e) {
			this.finished = true;
			return null;
		}
	}
1207470
public byte[] readRecord() throws IOException {
        if (this.debug) {
            System.err.println("ReadRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
        }

        if (this.inStream == null) {
            throw new IOException("reading from an output buffer");
        }

        if (this.currRecIdx >= this.recsPerBlock) {
            if (!this.readBlock()) {
                return null;
            }
        }

        byte[] result = new byte[this.recordSize];

        System.arraycopy(this.blockBuffer, (this.currRecIdx * this.recordSize), result, 0, this.recordSize);

        this.currRecIdx++;

        return result;
    }
1014644
private boolean next() throws IOException {
    if (valuesRead >= endOfPageValueCount) {
      if (valuesRead >= totalValueCount) {
        // How do we get here? Throw end of stream exception?
        return false;
      }
      readPage();
    }
    ++valuesRead;
    // TODO: Don't read for flat schemas
    //repetitionLevel = repetitionLevelColumn.nextInt();
    return definitionLevelColumn.nextInt() == maxDefLevel;
  }
1367876
public boolean hasNext() throws DBException
    {
        if (m_iCurrentRecord >= m_iRecordsAccessed)
            return true;
        Object record = this.next();
        if (record == null)
            return false;
        else
        {
            m_iRecordsAccessed--;   // Offically this record has not been accessed
            return true;
        }
    }
899337
public boolean readDestRecord(FieldList recSource, Record recDest)
    {
        FieldInfo fldSecond = recSource.getField("Name");
        if (fldSecond == null)
            fldSecond = recSource.getField("Description");
        if (fldSecond == null)
            return false;
        recDest = BaseFixData.getRecordFromDescription(fldSecond.toString(), fldSecond.getFieldName(), recDest);
        return (recDest != null);
    }
1156168
public boolean next() {
        checkState();
        if (mPlayerPlaylist.isEmpty()) {
            return false;
        }
        PlaybackService.play(getContext(), mClientKey, mPlayerPlaylist.next());
        return true;
    }
834747
public boolean reachEnd() throws IOException {
		// check if we have a read row that was not returned yet
		if (readRecord != null && !readRecordReturned) {
			return false;
		}
		// check if there are more rows to be read
		if (numReadRecords >= numTotalRecords) {
			return true;
		}
		// try to read next row
		return !readNextRecord();
	}
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;
    }