GT-2658 JAAS tweaks, javadoc, docs.

This commit is contained in:
dev747368 2019-09-05 12:59:49 -04:00
parent 220c3ff8d2
commit eff84e30d6
20 changed files with 412 additions and 305 deletions

View file

@ -1216,10 +1216,26 @@ public final class FileUtilities {
Desktop.getDesktop().open(file);
}
/**
* Processes each text line in a text file, in a separate thread.
* <p>
* Thread exits when EOF is reached.
*
* @param is {@link InputStream} to read
* @param consumer code that will process each text of the text file.
*/
public static void asyncForEachLine(InputStream is, Consumer<String> consumer) {
asyncForEachLine(new BufferedReader(new InputStreamReader(is)), consumer);
}
/**
* Processes each text line in a text file, in a separate thread.
* <p>
* Thread exits when EOF is reached.
*
* @param reader {@link BufferedReader} to read
* @param consumer code that will process each text of the text file.
*/
public static void asyncForEachLine(BufferedReader reader, Consumer<String> consumer) {
new Thread(() -> {
try {