This method will try to get the next file to be parsed.  It will skip over directories if encountered.

@param is
@throws IOException
5723
private void getNextFile(final InputStream is) throws IOException {
    if (is instanceof  java.util.zip.ZipInputStream) {
      ZipEntry ze = ((ZipInputStream) is).getNextEntry();
      while (ze != null && ze.isDirectory())
        ze = ((ZipInputStream) is).getNextEntry();
    }
  }
239329
protected void skip() throws IOException {
        if (this.eor) {
            return;
        }

        // Read to the end of the body of the record.  Exhaust the stream.
        // Can't skip direct to end because underlying stream may be compressed
        // and we're calculating the digest for the record.
        int r = available();
        while (r > 0 && !this.eor) {
            skip(r);
            r = available();
        }
    }
629316
private void nextChunk() throws IOException {
        if (!this.bof) {
            this.readCrlf();
        }
        this.size = ChunkedInputStream.chunkSize(this.origin);
        this.bof = false;
        this.pos = 0;
        if (this.size == 0) {
            this.eof = true;
        }
    }
234407
static private long skipForward(InputStream is, long toSkip)
                throws IOException {

        long eachSkip = 0;
        long skipped = 0;

        while (skipped != toSkip) {
            eachSkip = is.skip(toSkip - skipped);

            // check if EOF is reached
            if (eachSkip <= 0) {
                if (is.read() == -1) {
                    return skipped ;
                } else {
                    skipped++;
                }
            }
            skipped += eachSkip;
        }
        return skipped;
    }
351135
private static int read(InputStream is) throws IOException {
        int b = is.read();
        if (b == -1) {
            throw new EOFException();
        }
        return b;
    }
345007
public void readFrom(InputStream is) throws IOException {
        while(true) {
            if(count==buf.length) {
                // reallocate
                byte[] data = new byte[buf.length*2];
                System.arraycopy(buf,0,data,0,buf.length);
                buf = data;
            }

            int sz = is.read(buf,count,buf.length-count);
            if(sz<0)     return;
            count += sz;
        }
    }
140386
private void getNextFileToRead() throws IOException {
    if (this.currentFile != null && this.currentFileItr != null) {
      closeCurrentFile();
      incrementBytesReadCounter();
    }

    while (!this.hasNext && !this.filesToPull.isEmpty()) {
      this.currentFile = this.filesToPull.remove(0);
      this.currentFileItr = downloadFile(this.currentFile);
      this.hasNext = this.currentFileItr == null ? false : this.currentFileItr.hasNext();
      LOG.info("Will start downloading file: " + this.currentFile);
    }
  }
262368
int next() throws IOException, UnterminatedCommentException {
		int c = get();
		if (c == '/') {
			switch (peek()) {
			case '/':
				for (;;) {
					c = get();
					if (c <= '\n') {
						return c;
					}
				}

			case '*':
				get();
				for (;;) {
					switch (get()) {
					case '*':
						if (peek() == '/') {
							get();
							return ' ';
						}
						break;
					case EOF:
						throw new UnterminatedCommentException();
					}
				}

			default:
				return c;
			}

		}
		return c;
	}
1033962
private void checkFile() throws IORuntimeException {
		if (false == file.exists()) {
			throw new IORuntimeException("File not exist: " + file);
		}
		if (false == file.isFile()) {
			throw new IORuntimeException("Not a file:" + file);
		}
	}
667872
protected void readFileId() throws IOException {
    byte[] b = new byte[HEADER.length];
    in.readFully(b);

    if (!Arrays.equals(b, HEADER)) {
      throw new IOException(
          "file_id_string does not match. got: " + new String(b, Charsets.ISO_8859_1));
    }
  }
603448
@Override
    public synchronized File read()
        throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException {

        if (walker == null) {
            this.walker = new SimpleDirectoryWalker(rootDirectory);
            this.walker.start();
            //skip ahead if items have already been processed.
            long itemsRead = getItemsRead();
            if (itemsRead > 0) {
                for (int i = 0; i < itemsRead; i++) {
                    this.walker.next();
                }
            }
        }

        return this.walker.next();
    }
1087572
private void skipPromotedIndex(final DataInput in) throws IOException {
        final int size = in.readInt();
        if (size <= 0) {
            return;
        }

        FileUtils.skipBytesFully(in, size);
    }
1141263
void fileReadCheck(String filePath) {
        File potentialFile = new File(filePath);
        String canonicalPath;
        try {
            canonicalPath = potentialFile.getCanonicalPath();
        } catch (IOException e) {
            error("Error getting canonical path", e);
            throw getException(filePath);
        }

        if (forbiddenReadFiles.stream().anyMatch(canonicalPath::startsWith)) {
            throw getException(filePath);
        }
    }
1208899
@Override
  public boolean isDirectory(final Path f) throws IOException {
    if (stocatorPath.isTemporaryPath(f)) {
      return false;
    }
    final Path path = storageClient.qualify(f);
    try {
      FileStatus fileStatus = getFileStatus(path);
      LOG.debug("is directory: {} : {}", path.toString(), fileStatus.isDirectory());
      return fileStatus.isDirectory();
    } catch (FileNotFoundException e) {
      return false;
    }
  }
86821
@Override
    public FileEntry next () {
        FileEntry n = this.next;
        try {
            FileEntry ne = advance();
            if ( ne == null ) {
                doClose();
                return n;
            }
            this.next = ne;
        }
        catch ( CIFSException e ) {
            log.warn("Enumeration failed", e);
            this.next = null;
        }
        return n;
    }
138145
private boolean readNextChunkFromFile() throws IOException {
        if (readOffset >= filledUpToWhenStarted || readOffset < 0) {
            return false;
        }

        bufferedReader.clear();
        dataFile.read(readOffset, bufferedReader);
        bufferedReader.position(0);
        if (bufferedReader.limit() > 0) {
            readOffset += bufferedReader.limit();
            while (bufferedReader.remaining() > 0) {
                byte[] dst = new byte[elementSize];
                bufferedReader.get(dst);
                pendingElements.add(dst);
            }
        }
        return true;
    }
1051373
private Event getNextEvent(Iterator<File> files) {
        while (files.hasNext()) {
            File file = files.next();

            // only consider files that end with FILE_SUFFIX
            if (!file.getAbsolutePath().endsWith(FILE_SUFFIX)) {
                continue;
            }

            Event event = fileToEvent(file);
            if (event != null) {
                return event;
            }
        }

        return null;
    }