|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.hunnysoft.jmime.TextUtil
Class that provides text utilities.
TextUtil provides various text utilities. All fields
and methods are static; therefore, you may not create instances of
TextUtil.
The EOL static field contains the default end-of-line
character sequence that the library uses when generating new lines of
text.
| Field Summary | |
static ByteString |
CRLF_EOL
Named constant for CR LF byte string. |
static ByteString |
EOL
The library's default end-of-line characters. |
static ByteString |
LF_EOL
Named constant for LF byte string. |
| Method Summary | |
static ByteString |
toCrLf(ByteString bstr)
Converts to CR LF end-of-line characters. |
static ByteString |
toDefaultEol(ByteString bstr)
Converts to the default end-of-line character sequence. |
static ByteString |
toLf(ByteString bstr)
Converts to LF end-of-line character. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final ByteString CRLF_EOL
public static final ByteString LF_EOL
public static ByteString EOL
The value of TextUtil.EOL determines the default
value for the end-of-line characters used by the library. If you
change its value, you should set it to one of the static fields
TextUtil.CRLF_EOL or TextUtil.LF_EOL. For
example, the following code:
TextUtil.EOL = TextUtil.CRLF_EOL;
will set CR LF as the default end-of-line characters for the library.
The value of EOL does not affect the way Hunny
JMIME performs parsing. The assemble() member
functions of some classes use EOL to append end-of-line
characters.
EOL is static. You must be careful when you set
its value in a multithreaded environment. You should set its value
from your main thread when the program begins.
The default value for EOL is
TextUtil.CRLF_EOL.
The MIME standard requires CR LF as the characters used for the
end-of-line sequence. However, in the C and Unix programming
environment, LF alone (frequently called "newline") is used for the
end-of-line sequence. In that environment, it is common for disk
I/O functions to convert to LF end-of-line sequence on input, and
convert to CR LF on output. For compatibility with such an
environment, JMIME allows you to change the default end-of-line
characters. To change the default to LF alone, set this field to
TextUtil.LF_EOL.
| Method Detail |
public static ByteString toCrLf(ByteString bstr)
bstr - byte string to convert
public static ByteString toLf(ByteString bstr)
bstr - byte string to convert
public static ByteString toDefaultEol(ByteString bstr)
The value of
bstr - byte string to convert
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||