public class VirgilByteArrayUtils extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
swigCMemOwn |
| Modifier | Constructor and Description |
|---|---|
protected |
VirgilByteArrayUtils(long cPtr,
boolean cMemoryOwn) |
| Modifier and Type | Method and Description |
|---|---|
static String |
bytesToHex(byte[] array)
Translate given byte array to the HEX string.
|
static String |
bytesToHex(byte[] array,
boolean formatted)
Translate given byte array to the HEX string.
|
static String |
bytesToString(byte[] array)
Represent given byte array as string.
|
void |
close() |
void |
delete() |
protected void |
finalize() |
protected static long |
getCPtr(VirgilByteArrayUtils obj) |
static byte[] |
hexToBytes(String hexStr)
Translate given HEX string to the byte array.
|
static byte[] |
jsonToBytes(String json)
Represents given JSON object as byte array in canonical form.
|
static byte[] |
stringToBytes(String str)
Represents given string as byte array.
|
protected VirgilByteArrayUtils(long cPtr,
boolean cMemoryOwn)
protected static long getCPtr(VirgilByteArrayUtils obj)
public void delete()
public void close()
close in interface AutoCloseablepublic static byte[] jsonToBytes(String json)
json - the json string.public static byte[] stringToBytes(String str)
str - the string.public static String bytesToString(byte[] array)
array - The byte array.public static byte[] hexToBytes(String hexStr)
hexStr - The HEX string.public static String bytesToHex(byte[] array, boolean formatted)
array - The byte array.formatted - If true, endline will be inserted every 16 bytes, and
all bytes will be separated with whitespaces.public static String bytesToHex(byte[] array)
array - The byte array.Copyright © 2016. All rights reserved.