public final class HexRepresentation extends Object implements BytesRepresentation
| Constructor and Description |
|---|
HexRepresentation()
Creates a new instance of HEX representation that uses default lower-cased letters.
|
HexRepresentation(boolean useLowerCase)
Creates a new instance of HEX representation that uses given casing of letters.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
toBytes(String hex)
Converts given
String in this representation back to to byte array. |
String |
toString(byte[] bytes)
Converts given byte array to
String in this representation. |
public HexRepresentation()
public HexRepresentation(boolean useLowerCase)
useLowerCase - flag whether use lower cased letters (true) or upper cased (false)public String toString(byte[] bytes) throws IllegalArgumentException
String in this representation.toString in interface BytesRepresentationbytes - bytes to be convertedIllegalArgumentException - possible exception if input is null or cannot be convertedpublic byte[] toBytes(String hex) throws IllegalArgumentException
String in this representation back to to byte array.toBytes in interface BytesRepresentationhex - HEX string input to be convertedIllegalArgumentException - possible exception if input is null or cannot be convertedCopyright © 2019. All rights reserved.