|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gargoylesoftware.htmlunit.TextUtil
public final class TextUtil
Utility methods relating to text.
| Field Summary | |
|---|---|
static String |
DEFAULT_CHARSET
Default encoding used. |
| Method Summary | |
|---|---|
static boolean |
startsWithIgnoreCase(String stringToCheck,
String prefix)
Return true if the string starts with the specified prefix, irrespective of case. |
static byte[] |
stringToByteArray(String content)
Convert a string into a byte array using a default encoding DEFAULT_CHARSET. |
static byte[] |
stringToByteArray(String content,
String charset)
Convert a string into a byte array using the given encoding. |
static InputStream |
toInputStream(String content)
Convert a string into an input stream. |
static InputStream |
toInputStream(String content,
String encoding)
Convert a string into an input stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_CHARSET
| Method Detail |
|---|
public static boolean startsWithIgnoreCase(String stringToCheck,
String prefix)
stringToCheck - The string to checkprefix - The prefix
public static InputStream toInputStream(String content)
content - The string
public static InputStream toInputStream(String content,
String encoding)
throws UnsupportedEncodingException
content - The stringencoding - The encoding to use when converting the string to a stream.
UnsupportedEncodingException - If the encoding is not supported.public static byte[] stringToByteArray(String content)
DEFAULT_CHARSET.
content - The string to convert, assumed to be DEFAULT_CHARSET encoded
public static byte[] stringToByteArray(String content,
String charset)
charset - The name of a supported charsetcontent - The string to convert
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||