|
||||||||||
| 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 java.lang.String |
DEFAULT_CHARSET
Default encoding used. |
| Method Summary | |
|---|---|
static boolean |
startsWithIgnoreCase(java.lang.String stringToCheck,
java.lang.String prefix)
Returns true if the string starts with the specified prefix, irrespective of case. |
static byte[] |
stringToByteArray(java.lang.String content)
Converts a string into a byte array using a default encoding DEFAULT_CHARSET. |
static byte[] |
stringToByteArray(java.lang.String content,
java.lang.String charset)
Converts a string into a byte array using the specified encoding. |
static java.io.InputStream |
toInputStream(java.lang.String content)
Convert a string into an input stream. |
static java.io.InputStream |
toInputStream(java.lang.String content,
java.lang.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 java.lang.String DEFAULT_CHARSET
| Method Detail |
|---|
public static boolean startsWithIgnoreCase(java.lang.String stringToCheck,
java.lang.String prefix)
stringToCheck - the string to checkprefix - the prefix
public static java.io.InputStream toInputStream(java.lang.String content)
content - the string
public static java.io.InputStream toInputStream(java.lang.String content,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
content - the stringencoding - the encoding to use when converting the string to a stream
java.io.UnsupportedEncodingException - if the encoding is not supportedpublic static byte[] stringToByteArray(java.lang.String content)
DEFAULT_CHARSET.
content - the string to convert, assumed to be DEFAULT_CHARSET encoded
public static byte[] stringToByteArray(java.lang.String content,
java.lang.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 | |||||||||