public class StringUtil
extends java.lang.Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
file2String(java.io.File file)
Convert the whole contexts of file into a string.
|
static java.lang.String |
file2String(java.io.File file,
java.lang.String enc)
Convert the whole contexts of file into a string.
|
static java.lang.String |
firstNonEmpty(java.lang.String... strings)
Returns the first non empty string in the list
|
static java.lang.String |
getHeader(java.lang.String s,
int headerLength)
Return header part with the defined headerLength.
|
static boolean |
isEmptyBytes(byte[] bytes) |
static boolean |
isEmptyString(java.lang.String s) |
static boolean |
isEmptyVarargs(java.lang.Object... objects) |
static java.lang.String |
md5sum(java.lang.String input)
Returns the MD5 checksum for the given UTF8 string data
|
static void |
string2File(java.lang.String data,
java.io.File file)
Write a string into a file.
|
static void |
string2File(java.lang.String data,
java.io.File file,
java.lang.String enc)
Write a string into a file.
|
static java.lang.String |
toCurrentStackString()
Convert the current position's stack info into a String.
|
static java.lang.String |
toString(java.io.InputStream is)
Convert InputStream to string using default CharSet
|
static java.lang.String |
toString(java.lang.Throwable t)
Convert the Throwable's all info into a String.
|
public static boolean isEmptyString(java.lang.String s)
s
- public static boolean isEmptyBytes(byte[] bytes)
bytes
- public static boolean isEmptyVarargs(java.lang.Object... objects)
objects
- public static java.lang.String getHeader(java.lang.String s, int headerLength)
s
- headerLength
- public static java.lang.String toString(java.lang.Throwable t)
public static java.lang.String toCurrentStackString()
public static java.lang.String file2String(java.io.File file) throws java.lang.Exception
java.lang.Exception
public static java.lang.String file2String(java.io.File file, java.lang.String enc) throws java.lang.Exception
java.lang.Exception
public static void string2File(java.lang.String data, java.io.File file) throws java.lang.Exception
java.lang.Exception
public static void string2File(java.lang.String data, java.io.File file, java.lang.String enc) throws java.lang.Exception
java.lang.Exception
public static java.lang.String toString(java.io.InputStream is) throws java.io.IOException
is
- java.io.IOException
public static java.lang.String md5sum(java.lang.String input)
input
- public static java.lang.String firstNonEmpty(java.lang.String... strings)
strings
-