I was writing a program and needed a Java class that would read some text a line at a time but also tell you what the last line seperator was, whether a line feed, carriage return or both. It was written very quickly, and may not be perfect, and it requires a java.io.Reader in the constructor that returns true for markSupported()
You can download it here: SmartBufferedReader.java