public final class EncodableHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static Charset |
charset
Default charset used to encode/decode String.
|
static String |
ENCODING_CHARSET_DFLT |
static String |
ENCODING_CHARSET_PROPERTY |
static String |
ENCODING_USE_JVM_CHARSET_PROPERTY |
(package private) static Logger |
logger |
private static boolean |
multibyte
Attributes allowing to compute encoded String size.
|
private static boolean |
utf8 |
| Constructor and Description |
|---|
EncodableHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Properties |
decodeProperties(Decoder decoder) |
static void |
encodeProperties(Properties properties,
Encoder encoder) |
static int |
getByteArrayEncodedSize(byte[] byteArray) |
static int |
getEncodedSize(Properties properties) |
static int |
getNullableByteArrayEncodedSize(byte[] byteArray) |
static int |
getNullableByteArrayEncodedSize(byte[] byteArray,
int length) |
static int |
getNullableStringEncodedSize(String s)
Returns the size of an encoded string which value may be null.
|
static int |
getStringEncodedSize(String s)
Returns the size of an encoded string.
|
static Logger logger
public static final String ENCODING_CHARSET_PROPERTY
public static final String ENCODING_USE_JVM_CHARSET_PROPERTY
public static final String ENCODING_CHARSET_DFLT
static final Charset charset
private static final boolean multibyte
private static final boolean utf8
public static final int getStringEncodedSize(String s)
s - the string to encodepublic static final int getNullableStringEncodedSize(String s)
s - the string to encodepublic static final int getByteArrayEncodedSize(byte[] byteArray)
public static final int getNullableByteArrayEncodedSize(byte[] byteArray)
public static final int getNullableByteArrayEncodedSize(byte[] byteArray,
int length)
public static int getEncodedSize(Properties properties) throws Exception
Exceptionpublic static void encodeProperties(Properties properties, Encoder encoder) throws Exception
Exceptionpublic static Properties decodeProperties(Decoder decoder) throws Exception
ExceptionCopyright © 2022 ScalAgent D.T.. All rights reserved.