@Override
    public boolean hasNext() {
        int available = 0;
        try {
            available = logFileStream.available();
        } catch (IOException e) {
            logger.error("Fail to access log file and try to close stream, log file path: " + currentFileName, e);
            try {
                logFileStream.close();
            } catch (IOException ex) {
                logger.error("Fail to close log file, log file path: " + currentFileName, ex);
            }
        }
        if (available <= 0) {
            try {
                logFileStream.close();
            } catch (IOException e) {
                logger.error("Fail to close log file, log file path: " + currentFileName, e);
            }
        }
        return available > 0;
    }