public class Formatter extends Object
Constructor and Description |
---|
Formatter() |
Modifier and Type | Method and Description |
---|---|
static String |
format(double value,
String pattern)
Format double into a string with pattern
|
static String |
format(float value,
String pattern)
Format float into a string with pattern
|
static byte[] |
hexStringToByte(String str)
Hex string to byte array
|
static String |
toHexString(byte value)
Convert byte to a string in hex, like %02x
|
static String |
toHexString(byte[] byteArray)
Convert byte array to a string
|
static String |
toHexString(byte[] values,
int offset,
int length,
String seperate)
Convert byte array to a string
|
public static String format(double value, String pattern)
value
- double inputpattern
- format pattern - .##public static String format(float value, String pattern)
value
- float inputpattern
- format pattern - .##public static byte[] hexStringToByte(String str)
str
- hex stringpublic static String toHexString(byte value)
value
- bytepublic static String toHexString(byte[] byteArray)
byteArray
- byte array