class EolHelper {

    @SuppressFBWarnings("DM_DEFAULT_ENCODING")
    public static String findEol(File textFile) throws IOException {
        if (textFile == null) {
            throw new IllegalArgumentException("Text file object cannot be null");
        }
        if (!textFile.isFile()) {
            throw new IllegalArgumentException("Text file is not a file");
        }
        if (textFile.length() == 0) {
            return null;
        }
        EolBufferedReader eolBufferedReader = null;
        try {
            eolBufferedReader = new EolBufferedReader(new BufferedReader(new FileReader(textFile)));
            String line = eolBufferedReader.readLineKeepEol();
            return getEndEol(line);
        } finally {
            if (eolBufferedReader != null) eolBufferedReader.close();
        }
    }

}