public final class LineUtil extends Object
Modifier and Type | Method and Description |
---|---|
static Consumer<String> |
lineConsumer(PrintStream ps)
Prints the consumed strings as lines to the given
PrintStream . |
static <T extends CharSequence> |
lineConsumer(PrintWriter pw)
Prints the consumed strings as lines to the given
PrintWriter . |
static ConsumerWhichThrows<String,IOException> |
lineConsumer(Writer w)
Writes the consumed strings as lines to the given
Writer . |
static ConsumerWhichThrows<String,IOException> |
lineConsumerISO8859_1(OutputStream out)
Writes the consumed strings as lines to the ISO 8859-1-encoded
OutputStream . |
static Producer<CharSequence> |
lineProducer(CharSequence text)
Produces lines from a CharSequence by splitting that at line breaks.
|
static ProducerWhichThrows<String,IOException> |
lineProducer(Reader r)
Produces lines from a
Reader . |
static Producer<String> |
lineProducer(String text)
Produces lines from a string by splitting that at line breaks.
|
static ProducerWhichThrows<String,IOException> |
lineProducerISO8859_1(InputStream in)
Produces lines from a ISO 8859-1-encoded
InputStream . |
static List<String> |
readAllLines(Reader r,
boolean closeReader)
Reads lines from the given reader until end-of-input.
|
static ProducerWhichThrows<String,IOException> |
readLineWithSeparator(Reader r)
Similar to
BufferedReader.readLine() , except that
The produced strings include the line separator
Not only CR, LF and CRLF are recognized as line terminators, but also some other special characters, as
described here
|
public static ProducerWhichThrows<String,IOException> lineProducerISO8859_1(InputStream in)
InputStream
.public static ProducerWhichThrows<String,IOException> lineProducer(Reader r)
Reader
.public static Producer<String> lineProducer(String text)
public static Producer<CharSequence> lineProducer(CharSequence text)
public static ProducerWhichThrows<String,IOException> readLineWithSeparator(Reader r)
BufferedReader.readLine()
, except that
r
- The source of charactersnull
at end-of-inputpublic static ConsumerWhichThrows<String,IOException> lineConsumerISO8859_1(OutputStream out)
OutputStream
.public static ConsumerWhichThrows<String,IOException> lineConsumer(Writer w)
Writer
.public static <T extends CharSequence> Consumer<T> lineConsumer(PrintWriter pw)
PrintWriter
.public static Consumer<String> lineConsumer(PrintStream ps)
PrintStream
.public static List<String> readAllLines(Reader r, boolean closeReader) throws IOException
IOException
Copyright © 2018 Arno Unkrig. All rights reserved.