public class ManReaderExt extends Object
| Constructor and Description |
|---|
ManReaderExt() |
| Modifier and Type | Method and Description |
|---|---|
static BufferedReader |
buffered(Reader thiz)
Returns a buffered reader wrapping this Reader, or this Reader itself if it is already buffered.
|
static BufferedReader |
buffered(Reader thiz,
int bufferSize) |
static void |
forEachLine(Reader thiz,
java.util.function.Consumer<String> action)
Iterates through each line of this reader, calls [action] for each line read
and closes the [Reader] when it's completed.
|
static List<String> |
readLines(Reader thiz)
Reads this reader content as a list of lines.
|
static <T> T |
useLines(Reader thiz,
java.util.function.Function<Iterable<String>,T> block)
Calls the [block] callback giving it a sequence of all the lines in this file and closes the reader once
the processing is complete.
|
public static BufferedReader buffered(Reader thiz)
public static BufferedReader buffered(Reader thiz, int bufferSize)
public static void forEachLine(Reader thiz, java.util.function.Consumer<String> action)
action - function to process file lines.public static List<String> readLines(Reader thiz)
public static <T> T useLines(Reader thiz, java.util.function.Function<Iterable<String>,T> block)
Copyright © 2018. All rights reserved.