public final class Asn1StringUtils extends Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
EMPTY_BYTES
The empty byte[]
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
asciiStringToByte(String string)
Transform a string to an array of ASCII bytes, where the byte array will contain
only values in [0, 127].
|
static String |
dumpByte(byte octet)
Helper function that dump a byte in hex form
|
static String |
dumpBytes(byte[] buffer)
Helper function that dump an array of bytes in hex form
|
static String |
dumpBytes(byte[] buffer,
int start,
int length)
Helper function that dump an array of bytes in hex form
|
static byte[] |
getBytesUtf8(String string)
Return UTF-8 encoded byte[] representation of a String
|
public static final byte[] EMPTY_BYTES
public static String dumpByte(byte octet)
octet
- The byte to dumppublic static String dumpBytes(byte[] buffer)
buffer
- The bytes array to dumppublic static String dumpBytes(byte[] buffer, int start, int length)
buffer
- The bytes array to dumpstart
- The starting point in the bufferlength
- The number of bytes to printpublic static byte[] getBytesUtf8(String string)
string
- The string to be transformed to a byte arraypublic static byte[] asciiStringToByte(String string)
string
- The byte array to transformCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.