|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compoze.collab.util.Utf7Utility
public class Utf7Utility
Utility methods for decoding UTF-7 encoded messages.
Field Summary | |
---|---|
static String |
UTF_7
|
Method Summary | |
---|---|
static int |
decodeFromUtf7(byte[] yBytes,
int iByteCount,
char[] cChars)
Decode an array of bytes representing a UTF-7 encoding into the corresponding characters. |
static String |
decodeUtf7Text(String sEtext)
Decode "unstructured" headers encoded in UTF-7, that is, headers that are defined as '*text' as per RFC 822. |
static String |
decodeUtf7Word(String sEword)
The string is parsed using the rules in RFC 2047 for parsing an "encoded-word". |
static Object |
getContent(Part part)
Get the content of a Part , properly handling parts that
use the UTF-7 character set. |
static Reader |
newInputStreamReader(InputStream in,
String sEnc)
Return a Reader for an InputStream for any of the normal
supported encodings or "UTF-7". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UTF_7
Method Detail |
---|
public static String decodeUtf7Text(String sEtext) throws UnsupportedEncodingException
The string is decoded using the algorithm specified in RFC 2047, Section 6.1.1. If the charset-conversion fails for any sequence, an UnsupportedEncodingException is thrown. If the String is not an RFC 2047 style encoded header, it is returned as-is
sEtext
- the possibly encoded value
UnsupportedEncodingException
- if the charset
conversion failed.public static String decodeUtf7Word(String sEword) throws ParseException, UnsupportedEncodingException
sEword
- the possibly encoded value
ParseException
- if the string is not an
encoded-word as per RFC 2047.
UnsupportedEncodingException
- if the charset
is not UTF-7.public static int decodeFromUtf7(byte[] yBytes, int iByteCount, char[] cChars) throws CharConversionException
yBytes
- the bytes to decode.iByteCount
- the number of bytes to decode.cChars
- the output buffer. Making cChars as long as yBytes is
always sufficient.
CharConversionException
- if yBytes is not a valid UTF-7 encoding
or cChars is not large enoughpublic static Reader newInputStreamReader(InputStream in, String sEnc) throws UnsupportedEncodingException
Reader
for an InputStream
for any of the normal
supported encodings or "UTF-7".
in
- the InputStream to read fromsEnc
- the encoding
UnsupportedEncodingException
- if sEnc is neither "UTF-7" nor
one of the built-in encodingspublic static Object getContent(Part part) throws MessagingException, IOException
Part
, properly handling parts that
use the UTF-7 character set.
part
- the Part
MessagingException
IOException
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |