Package org.summerboot.jexpress.util
Class FormatterUtil
java.lang.Object
org.summerboot.jexpress.util.FormatterUtil
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic byte[]base64Decode(String encodedMime) static Stringbase64Encode(byte[] contentBytes) static byte[]base64MimeDecode(String encodedMime) static Stringbase64MimeEncode(byte[] contentBytes) static Stringstatic <T> Set<T>findDuplicates(List<T> listContainingDuplicates) static String[]getEnumNames(Class<? extends Enum<?>> e) static StringgetInsideParenthesesValue(String value) parseBindingAddresss(String bindAddresses) static String[]static String[]static byte[]For old Java before Java 17 HexFormat.of().parseHex(s)static String[]static String[]static Stringstatic StringprotectContentNumber(String plain, String keyword, String delimiter, String replaceWith) static String[]splitByLength(String plain, int chunckSize) static byte[]toByteArray(BufferedImage bi, String format) static <T> StringtoCSV(Collection<T> a) static StringtoString(ByteBuffer buffer) static StringtoString(ByteBuffer buffer, boolean showStatus, boolean showHeaderfooter, int showNumberOfBytesPerLine, String delimiter) static StringupdateProtectedLine(String line, boolean encrypt)
-
Field Details
-
log
protected static org.apache.logging.log4j.Logger log -
INT_MASK
public static final long INT_MASK- See Also:
-
SHORT_MASK
public static final int SHORT_MASK- See Also:
-
BYTE_MASK
public static final short BYTE_MASK- See Also:
-
NIBBLE_MASK
public static final short NIBBLE_MASK- See Also:
-
EMPTY_STR_ARRAY
-
REGEX_CSV
- See Also:
-
REGEX_URL
- See Also:
-
REGEX_BINDING_MAP
- See Also:
-
REGEX_EMAIL
- See Also:
-
REGEX_EMAIL_PATTERN
-
INSIDE_PARENTHESES_VALUE
-
-
Constructor Details
-
FormatterUtil
public FormatterUtil()
-
-
Method Details
-
parseDsv
-
parseCsv
-
parseURL
-
parseURL
-
toCSV
-
getEnumNames
-
getInsideParenthesesValue
-
updateProtectedLine
public static String updateProtectedLine(String line, boolean encrypt) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
b2n
-
parseBindingAddresss
-
parseMap
-
convertTo
public static String convertTo(String value, String targetCharsetName) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
base64MimeEncode
-
base64MimeDecode
-
base64Encode
-
base64Decode
-
toByteArray
- Parameters:
bi-format- - png- Returns:
- Throws:
IOException- ImageIO failed to access system cache dir
-
toString
-
toString
public static String toString(ByteBuffer buffer, boolean showStatus, boolean showHeaderfooter, int showNumberOfBytesPerLine, String delimiter) -
parseHex
For old Java before Java 17 HexFormat.of().parseHex(s)- Parameters:
hexString- must be an even-length string- Returns:
-
findDuplicates
-
protectContentNumber
-
protectContent
-
splitByLength
-