public class ASCIIUtil extends Object
Constructor and Description |
---|
ASCIIUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
fold(int used,
String s)
Perform RFC 2047 text folding on a string of text.
|
static String |
getBinaryTransferEncoding(InputStream content)
Determine if the transfer encoding looks like it might be
valid ascii text, and thus transferable as 7bit code.
|
static String |
getTextTransferEncoding(InputStream content)
Examine a stream of text and make a judgement on what encoding
type should be used for the text.
|
static String |
getTextTransferEncoding(String content)
Examine a stream of text and make a judgement on what encoding
type should be used for the text.
|
static boolean |
isAscii(int ch)
Test to see if a given character can be considered "valid" ASCII.
|
static boolean |
isAscii(String s)
Test to see if this string contains only US-ASCII (i.e., 7-bit
ASCII) charactes.
|
static String |
unfold(String s)
Unfold a folded string.
|
public static boolean isAscii(String s)
s
- The test string.public static boolean isAscii(int ch)
ch
- The test character.public static String getTextTransferEncoding(InputStream content) throws IOException
content
- An input stream for the content we're examining.IOException
public static String getTextTransferEncoding(String content)
content
- A string for the content we're examining.public static String getBinaryTransferEncoding(InputStream content) throws IOException
content
- An input stream for the content we're examining.IOException
public static String fold(int used, String s)
used
- The amount of text already "used up" on this line. This is
typically the length of a message header that this text
get getting added to.s
- The text to fold.Copyright © 2013. All Rights Reserved.