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) |
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
Copyright © 2017. All rights reserved.