public final class MiscUtil extends Object
| Constructor and Description |
|---|
MiscUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildLogString(byte[] bytes,
boolean isReceived) |
static <T> T |
checkArgumentNotEmpty(T value,
String msg) |
static <T> T |
checkNotNull(T value,
String msg) |
static String |
encodeText(String name)
To make sure email clients can interpret text properly, we need to encode some values according to RFC-2047.
|
static String |
extractCID(String cid) |
static String[] |
extractEmailAddresses(String emailAddressList)
Recognizes the tails of each address entry, so it can replace the [';] delimiters, thereby disambiguating the delimiters, since they can
appear in names as well (making it difficult to split on [,;] delimiters.
|
static String |
readInputStreamToString(InputStream inputStream,
Charset charset)
Uses standard JDK java to read an inputstream to String using the given encoding (in
ByteArrayOutputStream.toString(String)). |
static int |
toInt(byte b) |
static <T> boolean |
valueNullOrEmpty(T value) |
public static <T> T checkNotNull(T value,
String msg)
public static <T> T checkArgumentNotEmpty(T value,
String msg)
public static <T> boolean valueNullOrEmpty(T value)
public static String buildLogString(byte[] bytes, boolean isReceived)
public static int toInt(byte b)
public static String encodeText(@Nullable String name)
@Nonnull public static String readInputStreamToString(@Nonnull InputStream inputStream, @Nonnull Charset charset) throws IOException
ByteArrayOutputStream.toString(String)).IOException@Nonnull public static String[] extractEmailAddresses(@Nonnull String emailAddressList)
emailAddressList - The delimited list of addresses (or single address) optionally including the name.Copyright © 2017. All rights reserved.