public class MPMsg extends ArrayList
Ahh, the joys of nearly ridiculous over-engineering.
Not only do AIM ICBM's support multiple channels. Not only do they support multiple character sets, but they support multiple character sets/encodings within the same ICBM.
These multipart messages allow for complex space savings techniques, which seem utterly unnecessary by today's standards. In fact, there is only one client still in popular use that still uses this method: AOL for the Macintosh, Version 5.0. Obscure, yes, I know.
In modern (non-legacy) clients, if the user tries to send a character that is not ISO-8859-1 or ASCII, the client will send the entire message as UNICODE, meaning that every character in the message will occupy the full 16-bit UNICODE field, even if the high order byte would be zero. Multipart messages prevent this wasted space by allowing the client to only send the characters in UNICODE that need to be sent that way, and the rest of the message can be sent in whatever the native character set is (probably ASCII).
An important note is that sections will be displayed in the order that they appear in the ICBM. There is no facility for merging or rearranging sections at run time. So if you have, say, ASCII then UNICODE then ASCII, you must supply two ASCII sections with a UNICODE in the middle, and incur the associated overhead.
Normally I would have laughed and given a firm "no" to supporting this seldom-used feature, but something is attracting me to it. In the future, it may be possible to abuse this to send mixed-media messages to other open source clients (i.e., encryption).
I would definitely recommend avoiding this feature unless you really know what you are doing, and/or you have something neat to do with it.
modCount
Constructor and Description |
---|
MPMsg()
Creates a new multi-part message.
|
MPMsg(int size)
Creates a new multi-part message of the specified size.
|
Modifier and Type | Method and Description |
---|---|
void |
addSection(MPMsgSection sec)
Add a message section to the mutli-part message.
|
void |
addSectionASCII(String ascii)
Add an ASCII encoded string section to the multi-part message.
|
void |
addSectionISO88591(String iso88591)
Add an ISO-8859-1 string section to the multi-part message.
|
void |
addSectionRaw(int charset,
int charSubset,
String data)
Add a raw string section to the multi-part message.
|
void |
addSectionUnicode(String unicode)
Add a Unicode (UTF-16BE) string section to the multi-part message.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
public MPMsg()
public MPMsg(int size)
size
- the sizepublic void addSection(MPMsgSection sec)
sec
- the message section to addpublic void addSectionRaw(int charset, int charSubset, String data)
charset
- the character setcharSubset
- the character subsetdata
- the raw stringpublic void addSectionASCII(String ascii)
ascii
- the ASCII encoded stringpublic void addSectionUnicode(String unicode)
unicode
- the Unicode (UTF-16BE) encoded stringpublic void addSectionISO88591(String iso88591)
iso88591
- the ISO-8859-1 encoded string