de.unkrig.commons.io
Class LineUtil

java.lang.Object
  extended by de.unkrig.commons.io.LineUtil

public final class LineUtil
extends java.lang.Object

Various utility methods for processing lines in streams.


Method Summary
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 ProducerWhichThrows<java.lang.String,java.io.IOException> lineProducer(java.io.Reader r)
          Produces lines from a Reader.
static ProducerWhichThrows<java.lang.String,java.io.IOException> lineProducerISO8859_1(java.io.InputStream in)
          Produces lines from a ISO 8859-1-encoded InputStream.
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lineProducerISO8859_1

public static ProducerWhichThrows<java.lang.String,java.io.IOException> lineProducerISO8859_1(java.io.InputStream in)
Produces lines from a ISO 8859-1-encoded InputStream.


lineProducer

public static ProducerWhichThrows<java.lang.String,java.io.IOException> lineProducer(java.io.Reader r)
Produces lines from a Reader.


readLineWithSeparator

public static ProducerWhichThrows<java.lang.String,java.io.IOException> readLineWithSeparator(java.io.Reader r)
Similar to BufferedReader.readLine(), except that

Parameters:
r - The source of characters
Returns:
Produces one string for each parsed line and null at end-of-input

lineConsumerISO8859_1

public 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.