Java Reference
In-Depth Information
and you read them using EscContLineReader 's readLine() method, you get the following
lines:
Here is something I wanted to say: Try and Buy in every way.
Go Team!
Note in particular that my reader does provide a space character between the abutted parts of
the continued line because this is normally what you want when dealing with prose text. An
IOException is thrown if a file ends with the escape character.
IndentContLineReader reads lines, but if a line begins with a space or tab, that line is
joined to the preceding line. This is designed for reading email or news/message header
lines. Here is an example input file:
From: ian Tuesday, January 1, 2000 8:45 AM EST
To: Book-reviewers List
Received: by darwinsys.com (OpenBSD 2.6)
from localhost
at Tuesday, January 1, 2000 8:45 AM EST
Subject: Hey, it's 2000 and MY computer is still up
When read using an IndentContLineReader , this text comes out with the continued lines
joined together into longer single lines (we had to break this line to make it fit the margins of
the print book):
From: ian Tuesday, January 1, 2000 8:45 AM EST
To: Book-reviewers List
Received: by darwinsys.com (OpenBSD 2.6) from localhost at Tuesday, January 1, 2000
8:45 AM EST
Subject: Hey, it's 2000 and MY computer is still up
This class has a setContinueMode(boolean) method that lets you turn continuation mode
off. This would normally be used to process the body of a message. Because the header and
the body are separated by a null line in the text representation of messages, we can process
the entire message correctly as follows:
src/test/java/io/IndentContLineReaderTest.java
Search WWH ::




Custom Search