Package com.beanit.asn1bean.util
Class HexString
java.lang.Object
com.beanit.asn1bean.util.HexString
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendFromByte(byte b, StringBuilder builder) static voidappendFromBytes(StringBuilder builder, byte[] bytes, int offset, int length) static StringfromByte(byte b) Returns the byte as a hex string.static StringfromByte(int b) static StringfromBytes(byte[] bytes) static StringfromBytes(byte[] bytes, int offset, int length) static StringfromBytes(ByteBuffer buffer) static StringfromBytesFormatted(byte[] bytes) static StringfromBytesFormatted(byte[] bytes, int offset, int length) static StringfromInt(int i) Returns the integer value as hex string filled with leading zeros.static StringfromLong(long l) Returns the long value as hex string filled with leading zeros.static byte[]Converts the given hex string to a byte array.
-
Method Details
-
fromByte
Returns the byte as a hex string. If b is less than 16 the hex string returned contains a leading zero.- Parameters:
b- the byte to be converted- Returns:
- the hex string.
-
fromByte
-
fromInt
Returns the integer value as hex string filled with leading zeros.- Parameters:
i- the integer value to be converted- Returns:
- the hex string
-
fromLong
Returns the long value as hex string filled with leading zeros.- Parameters:
l- the long value to be converted- Returns:
- the hex string
-
fromBytes
-
fromBytesFormatted
-
fromBytes
-
fromBytes
-
fromBytesFormatted
-
toBytes
Converts the given hex string to a byte array.- Parameters:
hexString- the hex string- Returns:
- the bytes
- Throws:
NumberFormatException- if the string is not a valid hex string
-
appendFromByte
-
appendFromBytes
-