Class MixedEolHandlingReader

java.lang.Object
java.io.Reader
org.omegat.util.MixedEolHandlingReader
All Implemented Interfaces:
Closeable, AutoCloseable, Readable

public class MixedEolHandlingReader extends Reader
This reader tries to detect the correct EOL type for the input stream based on the frequency of EOL chars encountered within a lookahead range. Calling readLine() will return lines that include "bad" EOL chars.

For example an input that is detected to be CRLF that contains a line "foo\r\r\n" will return "foo\r" for that line. This differs from BufferedReader in that the latter will treat all EOL chars as starting new lines, so the above example would give "foo" and then "".