IndentContLineReader is = new IndentContLineReader(
new StringReader(sampleTxt));
String aLine;
// Print Mail/News Header
System.out.println("----- Message Header -----");
while ((aLine = is.readLine()) != null && aLine.length() > 0) {
System.out.println(is.getLineNumber() + ": " + aLine);
}
// Make "is" behave like normal BufferedReader
is.setContinuationMode(false);
System.out.println();
// Print Message Body
System.out.println("----- Message Body -----");
while ((aLine = is.readLine()) != null) {
System.out.println(is.getLineNumber() + ": " + aLine);
}
is.close();