public class UtilCharacterEncoding
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static char[] |
hexArray |
| Constructor and Description |
|---|
UtilCharacterEncoding() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
addBlankBeforeUpperCaseGroupAndDigitGroup(java.lang.String name) |
static java.lang.String |
bytesToHexString(byte[] bytes) |
static java.lang.String |
bytesToHexStringWithSpace(byte[] bytes) |
static java.lang.String |
decodeEBCDIC(byte[] sfData,
int offset,
int length,
AFPParserConfiguration config) |
static java.lang.Object |
hexStringWithSpacesToByteArray(java.lang.String text)
Turns the given String of hex digits into a byte array.
|
static boolean |
isEBCDIC(byte[] data) |
static boolean |
isHexDigit(char chr)
Returns true if the given char is a hex digit.
|
static java.lang.String |
reduceLabel(java.lang.String s) |
static byte[] |
stringToByteArray(java.lang.String str,
java.nio.charset.Charset charsetForEncoding,
int lenOfByteArray,
byte filler)
Converts the given
String into a byte array of given length using the given Charset for encoding. |
static int |
valOfHexDigit(char hexDigit)
Returns the hex value for a given character
|
public static int valOfHexDigit(char hexDigit)
public static boolean isHexDigit(char chr)
chr - character to test.public static java.lang.String bytesToHexString(byte[] bytes)
public static java.lang.String bytesToHexStringWithSpace(byte[] bytes)
public static byte[] stringToByteArray(java.lang.String str,
java.nio.charset.Charset charsetForEncoding,
int lenOfByteArray,
byte filler)
String into a byte array of given length using the given Charset for encoding. If the encoded bytes of the given String is shorter than the
given length, the additional encoded bytes are filled with given byte filler. If the encoded
bytes of the given String is longer than the given length, the additional encoded bytes
are truncated.str - String to encode.charsetForEncoding - Charset used for encoding.lenOfByteArray - length of the resulting byte array.filler - byte used for pedding if encoded string is shorter than given
length.Stringpublic static java.lang.String decodeEBCDIC(byte[] sfData,
int offset,
int length,
AFPParserConfiguration config)
public static boolean isEBCDIC(byte[] data)
public static java.lang.String reduceLabel(java.lang.String s)
public static java.lang.String addBlankBeforeUpperCaseGroupAndDigitGroup(java.lang.String name)
public static java.lang.Object hexStringWithSpacesToByteArray(java.lang.String text)