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,
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,
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, Consumer<String> action)
action
for each line read
and closes the Reader
when it's completed.action
- function to process file lines.public static List<String> readLines(Reader thiz)
Copyright © 2024. All rights reserved.