public final class LineUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Consumer<java.lang.String> |
lineConsumer(java.io.PrintStream ps)
Prints the consumed strings as lines to the given
PrintStream. |
static <T extends java.lang.CharSequence> |
lineConsumer(java.io.PrintWriter pw)
Prints the consumed strings as lines to the given
PrintWriter. |
static ConsumerWhichThrows<java.lang.String,java.io.IOException> |
lineConsumer(java.io.Writer w)
Writes the consumed strings as lines to the given
Writer. |
static ConsumerWhichThrows<java.lang.String,java.io.IOException> |
lineConsumerISO8859_1(java.io.OutputStream out)
Writes the consumed strings as lines to the ISO 8859-1-encoded
OutputStream. |
static Producer<java.lang.CharSequence> |
lineProducer(java.lang.CharSequence text)
Produces lines from a CharSequence by splitting that at line breaks.
|
static ProducerWhichThrows<java.lang.String,java.io.IOException> |
lineProducer(java.io.Reader r)
Produces lines from a
Reader. |
static Producer<java.lang.String> |
lineProducer(java.lang.String text)
Produces lines from a string by splitting that at line breaks.
|
static ProducerWhichThrows<java.lang.String,java.io.IOException> |
lineProducerISO8859_1(java.io.InputStream in)
Produces lines from a ISO 8859-1-encoded
InputStream. |
static java.util.List<java.lang.String> |
readAllLines(java.io.Reader r,
boolean closeReader)
Reads lines from the given reader until end-of-input.
|
static ProducerWhichThrows<java.lang.String,java.io.IOException> |
readLineWithSeparator(java.io.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<java.lang.String,java.io.IOException> lineProducerISO8859_1(java.io.InputStream in)
InputStream.public static ProducerWhichThrows<java.lang.String,java.io.IOException> lineProducer(java.io.Reader r)
Reader.public static Producer<java.lang.String> lineProducer(java.lang.String text)
public static Producer<java.lang.CharSequence> lineProducer(java.lang.CharSequence text)
public static ProducerWhichThrows<java.lang.String,java.io.IOException> readLineWithSeparator(java.io.Reader r)
BufferedReader.readLine(), except that
r - The source of charactersnull at end-of-inputpublic static ConsumerWhichThrows<java.lang.String,java.io.IOException> lineConsumerISO8859_1(java.io.OutputStream out)
OutputStream.public static ConsumerWhichThrows<java.lang.String,java.io.IOException> lineConsumer(java.io.Writer w)
Writer.public static <T extends java.lang.CharSequence> Consumer<T> lineConsumer(java.io.PrintWriter pw)
PrintWriter.public static Consumer<java.lang.String> lineConsumer(java.io.PrintStream ps)
PrintStream.public static java.util.List<java.lang.String> readAllLines(java.io.Reader r,
boolean closeReader)
throws java.io.IOException
java.io.IOException