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