public final class ConversionUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte |
byteDotNetToJvm(int i)
Conversion utility method, allows for a C# unsigned byte to be converted to a Java signed byte.
|
static int |
byteJvmToDotNet(byte b)
Conversion utility method, allows for a Java signed byte to be converted to a C# unsigned byte.
|
static <T> T |
changeType(java.lang.Object value,
java.lang.Class<T> targetType)
.NET-style Convert.ChangeType functionality.
|
static byte[] |
fromAlphanumericToByteArray(java.lang.String alphanumeric)
Converts an alphanumeric string to a byte array
|
static byte[] |
fromAlphanumericToByteArray(java.lang.String alphanumeric,
int startIndex,
int length)
Converts an alphanumeric string to a byte array
|
static UnsignedLong |
fromAlphanumericToUInt64(java.lang.String alphanumeric)
Converts an alphanumeric back to a ulong
|
static byte |
fromBase64ToByte(java.lang.String base64)
Converts a Base64 back to a byte.
|
static byte[] |
fromBase64ToByteArray(java.lang.String base64)
Converts a Base64 representation to a byte array.
|
static byte[] |
fromBase64ToByteArray(java.lang.String base64,
int startIndex,
int length)
Converts a Base64 representation to a byte array.
|
static short |
fromBase64ToInt16(java.lang.String base64)
Converts a Base64 back to a short.
|
static int |
fromBase64ToInt32(java.lang.String base64)
Converts a Base64 back to an int.
|
static long |
fromBase64ToInt64(java.lang.String base64)
Converts a Base64 back to a long.
|
static UnsignedShort |
fromBase64ToUInt16(java.lang.String base64)
Converts a Base64 back to a ushort.
|
static UnsignedInteger |
fromBase64ToUInt32(java.lang.String base64)
Converts a Base64 back to a uint.
|
static UnsignedLong |
fromBase64ToUInt64(java.lang.String base64)
Converts a Base64 back to a ulong.
|
static byte |
fromBinaryToByte(java.lang.String binary)
Converts a binary back to a byte.
|
static byte[] |
fromBinaryToByteArray(java.lang.String binary)
Converts a binary back to a byte[].
|
static byte[] |
fromBinaryToByteArray(java.lang.String binary,
int startIndex,
int length)
Converts a binary back to a byte[].
|
static short |
fromBinaryToInt16(java.lang.String binary)
Converts a binary back to a short.
|
static int |
fromBinaryToInt32(java.lang.String binary)
Converts a binary back to an int.
|
static long |
fromBinaryToInt64(java.lang.String binary)
Converts a binary back to a long.
|
static UnsignedShort |
fromBinaryToUInt16(java.lang.String binary)
Converts a binary back to a ushort.
|
static UnsignedInteger |
fromBinaryToUInt32(java.lang.String binary)
Converts a binary back to an uint.
|
static UnsignedLong |
fromBinaryToUInt64(java.lang.String binary)
Converts a binary back to a ulong.
|
static UnsignedByte |
fromBinaryToUInt8(java.lang.String binary)
Converts a binary back to an unsigned byte.
|
static byte |
fromHexToByte(java.lang.String hex)
Converts a hex back to a byte Hex representations can be endian dependent.
|
static byte[] |
fromHexToByteArray(java.lang.String hex)
Converts a hex string to a byte array Hex representations can be endian dependent.
|
static byte[] |
fromHexToByteArray(java.lang.String hex,
int startIndex,
int length)
Converts a hex string to a byte array Hex representations can be endian dependent.
|
static short |
fromHexToInt16(java.lang.String hex)
Converts a hex back to a short Hex representations can be endian dependent.
|
static int |
fromHexToInt32(java.lang.String hex)
Converts a hex back to an int Hex representations can be endian dependent.
|
static long |
fromHexToInt64(java.lang.String hex)
Converts a hex back to a long Hex representations can be endian dependent.
|
static UnsignedInteger |
fromHexToUInt16(java.lang.String hex)
Converts a hex back to a ushort Hex representations can be endian dependent.
|
static UnsignedInteger |
fromHexToUInt32(java.lang.String hex)
Converts a hex back to a uint Hex representations can be endian dependent.
|
static UnsignedLong |
fromHexToUInt64(java.lang.String hex)
Converts a hex back to a ulong Hex representations can be endian dependent.
|
static UnsignedByte |
fromHexToUInt8(java.lang.String hex)
Converts a hex back to a ushort Hex representations can be endian dependent.
|
static byte |
fromStringToByte(java.lang.String value)
Converts a string back to a byte
|
static short |
fromStringToInt16(java.lang.String value)
Converts a string back to a short
|
static int |
fromStringToInt32(java.lang.String value)
Converts a string back to an int
|
static long |
fromStringToInt64(java.lang.String value)
Converts a string back to a long
|
static UnsignedShort |
fromStringToUInt16(java.lang.String value)
Converts a string back to a ushort
|
static UnsignedInteger |
fromStringToUInt32(java.lang.String value)
Converts a string back to a uint
|
static UnsignedLong |
fromStringToUInt64(java.lang.String value)
Converts a string back to a ulong
|
static UnsignedByte |
fromStringToUInt8(java.lang.String value)
Converts a string back to an unsigned byte
|
static org.joda.time.Duration |
fromXMLDuration(javax.xml.datatype.Duration value)
Converts an XML Duration data type to a Joda Duration
|
static org.joda.time.LocalDateTime |
fromXMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar value)
Converts an XML Gregorian Calendar data type to a Joda LocalDateTime
|
static long |
pack64(int a,
int b)
Packs two 32-bit integers into a 64-bit long (a,b => ab)
|
static java.lang.String |
toAlphanumeric(byte[] ba)
Converts a byte array to alphanumeric
|
static java.lang.String |
toAlphanumeric(byte[] ba,
int offset,
int length)
Converts a byte array to alphanumeric
|
static java.lang.String |
toAlphanumeric(UnsignedLong num)
Converts a number to alphanumeric, e.g.
|
static java.lang.String |
toAlphanumeric(UnsignedLong num,
boolean padLeft)
Converts a number to alphanumeric, e.g.
|
static java.lang.String |
toBase64(byte num)
Converts a number to Base64.
|
static java.lang.String |
toBase64(byte[] array)
Converts a byte array to Base64.
|
static java.lang.String |
toBase64(byte[] array,
int offset,
int length)
Converts a byte array to Base64.
|
static java.lang.String |
toBase64(int num)
Converts a number to Base64.
|
static java.lang.String |
toBase64(long num)
Converts a number to Base64.
|
static java.lang.String |
toBase64(short num)
Converts a number to Base64.
|
static java.lang.String |
toBase64(UnsignedInteger num)
Converts a number to Base64.
|
static java.lang.String |
toBase64(UnsignedLong num)
Converts a number to Base64.
|
static java.lang.String |
toBase64(UnsignedShort num)
Converts a number to Base64.
|
static java.lang.String |
toBinary(byte num)
Converts a number to binary
|
static java.lang.String |
toBinary(byte[] bytes)
Converts a byte array to a binary string.
|
static java.lang.String |
toBinary(byte[] bytes,
int startIndex,
int length)
Converts a byte array to a binary string.
|
static java.lang.String |
toBinary(byte num,
boolean padLeft)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(int num)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(int num,
boolean padLeft)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(long num)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(long num,
boolean padLeft)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(short num)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(short num,
boolean padLeft)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedByte num)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedByte num,
boolean padLeft)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedInteger num)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedInteger num,
boolean padLeft)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedLong num)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedLong num,
boolean padLeft)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedShort num)
Converts a number to binary, e.g.
|
static java.lang.String |
toBinary(UnsignedShort num,
boolean padLeft)
Converts a number to binary, e.g.
|
static byte[] |
toByteArray(java.lang.String text)
Converts a UTF8-encoded string to a byte[]
|
static byte[] |
toByteArray(java.lang.String text,
java.nio.charset.Charset encoding)
Converts a string to a byte[]
|
static byte[] |
toByteArray(java.lang.String text,
java.nio.charset.Charset encoding,
int index,
int count)
Converts a string to a byte[]
|
static byte[] |
toByteArray(java.lang.String text,
int index,
int count)
Converts a UTF8-encoded string to a byte[]
|
static java.lang.String |
toHex(byte num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(byte[] ba)
Converts a byte array to hex Hex representations can be endian dependent.
|
static java.lang.String |
toHex(byte[] ba,
int offset,
int length)
Converts a byte array to hex Hex representations can be endian dependent.
|
static java.lang.String |
toHex(byte num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(int num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(int num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(long num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(long num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(short num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(short num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedByte num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedByte num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedInteger num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedInteger num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedLong num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedLong num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedShort num)
Converts a number to hex, e.g.
|
static java.lang.String |
toHex(UnsignedShort num,
boolean padLeft)
Converts a number to hex, e.g.
|
static java.lang.String |
toHumanReadable(java.math.BigDecimal number)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(java.math.BigDecimal number,
int decimalPlaces)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(byte number)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(double number)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(double number,
int decimalPlaces)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(org.joda.time.Duration ts)
Returns the value of the given timespan in a human-readable form, appending the suffix.
|
static java.lang.String |
toHumanReadable(org.joda.time.Duration ts,
java.lang.String suffix)
Returns the value of the given timespan in a human-readable form, appending the suffix.
|
static java.lang.String |
toHumanReadable(float number)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(float number,
int decimalPlaces)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(int number)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(long number)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toHumanReadable(org.joda.time.Period p) |
static java.lang.String |
toHumanReadable(short number)
Returns the value of the given number in a human-readable form.
|
static java.lang.String |
toString(byte[] ba)
Converts a byte array to a UTF8-encoded string
|
static java.lang.String |
toString(byte[] ba,
java.nio.charset.Charset encoding)
Converts a byte array to an encoded string
|
static java.lang.String |
toString(byte[] ba,
java.nio.charset.Charset encoding,
int index,
int count)
Converts a byte array to an encoded string
|
static java.lang.String |
toString(byte[] ba,
int index,
int count)
Converts a byte array to a UTF8-encoded string
|
static javax.xml.datatype.Duration |
toXMLDuration(org.joda.time.Duration value)
Converts a Joda Duration object to an XML Duration data type
|
static javax.xml.datatype.XMLGregorianCalendar |
toXMLGregorianCalendar(org.joda.time.LocalDateTime value)
Converts a Joda LocalDateTime object to an XML Gregorian Calendar data type
|
static int[] |
unpack64(long num)
Reversed the pack64() function
|
public static long pack64(int a, int b)
public static int[] unpack64(long num)
public static byte byteDotNetToJvm(int i)
public static int byteJvmToDotNet(byte b)
public static <T> T changeType(java.lang.Object value, java.lang.Class<T> targetType) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.NullPointerException
- An argument is null.java.lang.IllegalArgumentException
- An incompatible argument was passed (e.g. an array or annotation)java.lang.NumberFormatException
- An invalid input value was given that does not parse to the specified target typejava.lang.ClassCastException
- A class cast failedjava.lang.InstantiationException
java.lang.IllegalAccessException
public static org.joda.time.LocalDateTime fromXMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar value)
public static org.joda.time.Duration fromXMLDuration(javax.xml.datatype.Duration value)
public static javax.xml.datatype.XMLGregorianCalendar toXMLGregorianCalendar(org.joda.time.LocalDateTime value) throws javax.xml.datatype.DatatypeConfigurationException
javax.xml.datatype.DatatypeConfigurationException
public static javax.xml.datatype.Duration toXMLDuration(org.joda.time.Duration value) throws javax.xml.datatype.DatatypeConfigurationException
javax.xml.datatype.DatatypeConfigurationException
public static java.lang.String toBinary(UnsignedLong num, boolean padLeft)
public static java.lang.String toBinary(UnsignedLong num)
public static java.lang.String toBinary(long num, boolean padLeft)
public static java.lang.String toBinary(long num)
public static java.lang.String toBinary(UnsignedInteger num, boolean padLeft)
public static java.lang.String toBinary(UnsignedInteger num)
public static java.lang.String toBinary(int num, boolean padLeft)
public static java.lang.String toBinary(int num)
public static java.lang.String toBinary(UnsignedShort num, boolean padLeft)
public static java.lang.String toBinary(UnsignedShort num)
public static java.lang.String toBinary(short num, boolean padLeft)
public static java.lang.String toBinary(short num)
public static java.lang.String toBinary(UnsignedByte num, boolean padLeft)
public static java.lang.String toBinary(UnsignedByte num)
public static java.lang.String toBinary(byte num, boolean padLeft)
public static java.lang.String toBinary(byte num)
public static java.lang.String toBinary(byte[] bytes)
java.lang.NullPointerException
- An argument is null.public static java.lang.String toBinary(byte[] bytes, int startIndex, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.IllegalArgumentException
- An argument is out of range.public static int fromBinaryToInt32(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedInteger fromBinaryToUInt32(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static long fromBinaryToInt64(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedLong fromBinaryToUInt64(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static short fromBinaryToInt16(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedShort fromBinaryToUInt16(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static byte fromBinaryToByte(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedByte fromBinaryToUInt8(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static byte[] fromBinaryToByteArray(java.lang.String binary)
java.lang.NullPointerException
- An argument is null.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static byte[] fromBinaryToByteArray(java.lang.String binary, int startIndex, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedInteger fromStringToUInt32(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static int fromStringToInt32(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedLong fromStringToUInt64(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static long fromStringToInt64(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedShort fromStringToUInt16(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static short fromStringToInt16(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedByte fromStringToUInt8(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static byte fromStringToByte(java.lang.String value)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static java.lang.String toHex(UnsignedLong num)
public static java.lang.String toHex(UnsignedLong num, boolean padLeft)
public static java.lang.String toHex(long num)
public static java.lang.String toHex(long num, boolean padLeft)
public static java.lang.String toHex(UnsignedInteger num)
public static java.lang.String toHex(UnsignedInteger num, boolean padLeft)
public static java.lang.String toHex(int num)
public static java.lang.String toHex(int num, boolean padLeft)
public static java.lang.String toHex(UnsignedShort num)
public static java.lang.String toHex(UnsignedShort num, boolean padLeft)
public static java.lang.String toHex(short num)
public static java.lang.String toHex(short num, boolean padLeft)
public static java.lang.String toHex(UnsignedByte num)
public static java.lang.String toHex(UnsignedByte num, boolean padLeft)
public static java.lang.String toHex(byte num)
public static java.lang.String toHex(byte num, boolean padLeft)
public static java.lang.String toHex(byte[] ba)
java.lang.NullPointerException
- An argument is null.public static java.lang.String toHex(byte[] ba, int offset, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.IllegalArgumentException
- An argument is out of range.public static byte[] fromHexToByteArray(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static byte[] fromHexToByteArray(java.lang.String hex, int startIndex, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedLong fromHexToUInt64(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static long fromHexToInt64(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedInteger fromHexToUInt32(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static int fromHexToInt32(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedInteger fromHexToUInt16(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static short fromHexToInt16(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedByte fromHexToUInt8(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static byte fromHexToByte(java.lang.String hex)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static java.lang.String toBase64(UnsignedLong num)
public static java.lang.String toBase64(long num)
public static java.lang.String toBase64(UnsignedInteger num)
public static java.lang.String toBase64(int num)
public static java.lang.String toBase64(UnsignedShort num)
public static java.lang.String toBase64(short num)
public static java.lang.String toBase64(byte num)
public static java.lang.String toBase64(byte[] array)
java.lang.NullPointerException
- An argument is null.public static java.lang.String toBase64(byte[] array, int offset, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.IllegalArgumentException
- An argument is out of range.public static long fromBase64ToInt64(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedLong fromBase64ToUInt64(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static int fromBase64ToInt32(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedInteger fromBase64ToUInt32(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static short fromBase64ToInt16(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedShort fromBase64ToUInt16(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static byte fromBase64ToByte(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.NumberFormatException
- A number could not be parsed.public static byte[] fromBase64ToByteArray(java.lang.String base64)
java.lang.NullPointerException
- An argument is null.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static byte[] fromBase64ToByteArray(java.lang.String base64, int startIndex, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of range.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static java.lang.String toAlphanumeric(UnsignedLong num)
public static java.lang.String toAlphanumeric(UnsignedLong num, boolean padLeft)
public static java.lang.String toAlphanumeric(byte[] ba)
java.lang.NullPointerException
- An argument is null.public static java.lang.String toAlphanumeric(byte[] ba, int offset, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.IllegalArgumentException
- An argument is out of range.public static byte[] fromAlphanumericToByteArray(java.lang.String alphanumeric)
java.lang.NullPointerException
- An argument is null.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static byte[] fromAlphanumericToByteArray(java.lang.String alphanumeric, int startIndex, int length)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.IllegalArgumentException
- An argument is out of range.java.lang.NumberFormatException
- A number could not be parsed.public static UnsignedLong fromAlphanumericToUInt64(java.lang.String alphanumeric)
java.lang.NullPointerException
- An argument is nulljava.lang.NumberFormatException
- A number could not be parsed.public static java.lang.String toHumanReadable(org.joda.time.Period p)
public static java.lang.String toHumanReadable(org.joda.time.Duration ts)
Example: 10 seconds become "less than a minute". Example: 1.1 minutes become "about a minute from now". Example: 50 minutes become "50 minutes". Example: 13 hours, 10 minutes become "about 13 hours". The suffix " ago" or " from now" is appended depending on the sign of the timespan.
public static java.lang.String toHumanReadable(org.joda.time.Duration ts, java.lang.String suffix)
public static java.lang.String toHumanReadable(long number)
public static java.lang.String toHumanReadable(int number)
public static java.lang.String toHumanReadable(short number)
public static java.lang.String toHumanReadable(byte number)
public static java.lang.String toHumanReadable(float number)
public static java.lang.String toHumanReadable(float number, int decimalPlaces)
java.lang.IllegalArgumentException
- An argument was invalidpublic static java.lang.String toHumanReadable(double number)
public static java.lang.String toHumanReadable(double number, int decimalPlaces)
java.lang.IllegalArgumentException
- An argument was invalidpublic static java.lang.String toHumanReadable(java.math.BigDecimal number)
java.lang.NullPointerException
- An argument is nullpublic static java.lang.String toHumanReadable(java.math.BigDecimal number, int decimalPlaces)
java.lang.NullPointerException
- An argument is nulljava.lang.IllegalArgumentException
- An argument was invalidpublic static byte[] toByteArray(java.lang.String text)
java.lang.NullPointerException
- An argument is null.java.lang.RuntimeException
- The UTF8 encoding is not supported.public static byte[] toByteArray(java.lang.String text, int index, int count)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of boundsjava.lang.IllegalArgumentException
- An argument is out of rangejava.lang.RuntimeException
- The UTF8 encoding is not supportedpublic static byte[] toByteArray(java.lang.String text, java.nio.charset.Charset encoding)
java.lang.NullPointerException
- An argument is null.public static byte[] toByteArray(java.lang.String text, java.nio.charset.Charset encoding, int index, int count)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of boundsjava.lang.IllegalArgumentException
- An argument is out of rangejava.lang.RuntimeException
- The UTF8 encoding is not supportedpublic static java.lang.String toString(byte[] ba)
public static java.lang.String toString(byte[] ba, int index, int count)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of boundsjava.lang.IllegalArgumentException
- An argument is out of rangepublic static java.lang.String toString(byte[] ba, java.nio.charset.Charset encoding)
java.lang.NullPointerException
- An argument is null.public static java.lang.String toString(byte[] ba, java.nio.charset.Charset encoding, int index, int count)
java.lang.NullPointerException
- An argument is null.java.lang.IndexOutOfBoundsException
- An index is out of boundsjava.lang.IllegalArgumentException
- An argument is out of range