public final class Conv
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
blankPadEBCDIC10(java.lang.String s)
Converts the specified String into a total of ten CCSID 37 bytes, blank padding with EBCDIC 0x40 as necessary.
|
static double |
byteArrayToDouble(byte[] data,
int offset)
Converts the specified bytes into a double value.
|
static float |
byteArrayToFloat(byte[] data,
int offset)
Converts the specified bytes into a float value.
|
static int |
byteArrayToInt(byte[] data,
int offset)
Converts the specified bytes into an int value.
|
static long |
byteArrayToLong(byte[] data,
int offset)
Converts the specified bytes into a long value.
|
static short |
byteArrayToShort(byte[] data,
int offset)
Converts the specified bytes into a short value.
|
static java.lang.String |
bytesToHexString(byte[] data,
int offset,
int length)
Converts the specified bytes into their hexadecimal String representation.
|
static java.lang.String |
bytesToHexString(byte[] data,
int offset,
int length,
char[] buffer)
Converts the specified bytes into their hexadecimal String representation.
|
static java.lang.String |
decfloat16ByteArrayToString(byte[] data,
int offset)
Converts the specified 8 bytes in decfloat16 format into a String.
|
static java.lang.String |
decfloat34ByteArrayToString(byte[] data,
int offset)
Converts the specified 16 bytes in decfloat34 format into a String.
|
static byte[] |
doubleToByteArray(double d)
Converts the specified double value into 8 bytes.
|
static void |
doubleToByteArray(double d,
byte[] data,
int offset)
Converts the specified double value into 8 bytes.
|
static void |
doubleToPackedDecimal(double d,
byte[] data,
int offset,
int numDigits,
int scale) |
static byte[] |
doubleToPackedDecimal(double d,
int numDigits,
int scale) |
static void |
doubleToZonedDecimal(double d,
byte[] data,
int offset,
int numDigits,
int scale) |
static byte[] |
doubleToZonedDecimal(double d,
int numDigits,
int scale) |
static java.lang.String |
ebcdicByteArrayToString(byte[] data,
char[] buffer) |
static java.lang.String |
ebcdicByteArrayToString(byte[] data,
int offset,
int length)
Converts the specified CCSID 37 bytes into a String.
|
static java.lang.String |
ebcdicByteArrayToString(byte[] data,
int offset,
int length,
char[] buffer)
Converts the specified CCSID 37 bytes into a String.
|
static java.lang.String |
ebcdicByteArrayToString(byte[] data,
int offset,
int length,
char[] buffer,
int ccsid)
Converts the specific CCSID bytes into a String.
|
static java.lang.String |
ebcdicByteArrayToString(byte[] data,
int offset,
int length,
int ccsid)
Converts the specific CCSID bytes into a String.
|
static char |
ebcdicByteToChar(byte b)
Converts the specified CCSID 37 byte into a Unicode char without creating any intermediate objects.
|
static byte[] |
floatToByteArray(float f)
Converts the specified float value into 4 bytes.
|
static void |
floatToByteArray(float f,
byte[] data,
int offset)
Converts the specified float value into 4 bytes.
|
static java.lang.String |
getDefaultNLV()
Return the default NLV for the client corresponding to the Java locale.
|
static byte[] |
hexStringToBytes(java.lang.String value)
Converts the specified hexadecimal String into its constituent byte values.
|
static int |
hexStringToBytes(java.lang.String value,
byte[] data,
int offset)
Converts the specified hexadecimal String into its constituent byte values.
|
static byte[] |
intToByteArray(int value)
Converts the specified int value into 4 bytes.
|
static void |
intToByteArray(int value,
byte[] data,
int offset)
Converts the specified int value into 4 bytes.
|
static boolean |
isSupported(int ccsid)
Returns true if the conversion to or from the specific CCSID is supported by the methods on this class.
|
static byte[] |
longToByteArray(long longValue)
Converts the specified long value into 8 bytes.
|
static void |
longToByteArray(long longValue,
byte[] data,
int offset)
Converts the specified long value into 8 bytes.
|
static void |
longToZonedDecimal(long l,
byte[] data,
int offset,
int numDigits)
The scale is 0, and 0 < numDigits <= 20.
|
static double |
packedDecimalToDouble(byte[] data,
int offset,
int numDigits,
int scale) |
static java.lang.String |
packedDecimalToString(byte[] data,
int offset,
int numDigits,
int scale)
Converts the specified packed decimal bytes into a String.
|
static java.lang.String |
packedDecimalToString(byte[] data,
int offset,
int numDigits,
int scale,
char[] buffer)
Converts the specified packed decimal bytes into a String.
|
static void |
shortToByteArray(int value,
byte[] data,
int offset)
Converts the specified short value into 2 bytes.
|
static void |
stringToBlankPadEBCDICByteArray(java.lang.String s,
byte[] data,
int offset,
int length)
Converts the specified String into CCSID 37 bytes, padding the byte array with EBCDIC spaces (0x40) up to length bytes.
|
static void |
stringToBlankPadEBCDICByteArray(java.lang.String s,
byte[] data,
int offset,
int length,
int ccsid)
Converts the specified String into bytes for the specified CCSID, padding the byte array with spaces up to length bytes.
|
static void |
stringToBlankPadUnicodeByteArray(java.lang.String s,
byte[] data,
int offset,
int length)
Converts the specified String into Unicode bytes, padding the byte array with Unicode
spaces (0x0020) up to length bytes.
|
static int |
stringToEBCDICByteArray(java.lang.String s,
byte[] data,
int offset,
int ccsid)
Converts the specified String into the appropriate byte values for the specified CCSID.
|
static byte[] |
stringToEBCDICByteArray(java.lang.String s,
int ccsid)
Converts the specified String into the appropriate byte values for the specified CCSID.
|
static int |
stringToEBCDICByteArray(java.lang.String s,
int length,
byte[] data,
int offset,
int ccsid)
Converts the specified String into the appropriate byte values for the specified CCSID.
|
static byte[] |
stringToEBCDICByteArray37(java.lang.String s)
Converts the specified String into CCSID 37 bytes.
|
static int |
stringToEBCDICByteArray37(java.lang.String s,
byte[] data,
int offset)
Converts the specified String into CCSID 37 bytes.
|
static int |
stringToEBCDICByteArray37(java.lang.String s,
int length,
byte[] data,
int offset) |
static byte[] |
stringToPackedDecimal(java.lang.String s,
int numDigits)
Converts the specified String (number) into packed decimal bytes.
|
static void |
stringToPackedDecimal(java.lang.String s,
int numDigits,
byte[] buffer,
int offset)
Converts the specified String (number) into packed decimal bytes.
|
static byte[] |
stringToUnicodeByteArray(java.lang.String s)
Converts the specified String into Unicode bytes.
|
static int |
stringToUnicodeByteArray(java.lang.String s,
byte[] data,
int offset)
Converts the specified String into Unicode bytes.
|
static void |
stringToUnicodeByteArray(java.lang.String s,
byte[] data,
int offset,
int byteLength) |
static int |
stringToUnicodeByteArray(java.lang.String s,
int length,
byte[] data,
int offset) |
static int |
stringToUtf8ByteArray(java.lang.String s,
int length,
byte[] data,
int offset) |
static byte[] |
stringToZonedDecimal(java.lang.String s,
int numDigits)
Converts the specified String (number) into zoned decimal bytes.
|
static void |
stringToZonedDecimal(java.lang.String s,
int numDigits,
byte[] buffer,
int offset)
Converts the specified String (number) into zoned decimal bytes.
|
static java.lang.String |
unicodeByteArrayToString(byte[] data,
int offset,
int length)
Converts the specified Unicode bytes into a String.
|
static java.lang.String |
unicodeByteArrayToString(byte[] data,
int offset,
int length,
char[] buffer)
Converts the specified Unicode bytes into a String.
|
static double |
zonedDecimalToDouble(byte[] data,
int offset,
int numDigits,
int scale) |
static int |
zonedDecimalToInt(byte[] data,
int offset,
int numDigits)
The scale is 0, and 0 < numDigits <= 10.
|
static long |
zonedDecimalToLong(byte[] data,
int offset,
int numDigits)
The scale is 0, and 0 < numDigits <= 20.
|
static java.lang.String |
zonedDecimalToString(byte[] data,
int offset,
int numDigits,
int scale)
Converts the specified zoned decimal bytes into a String.
|
static java.lang.String |
zonedDecimalToString(byte[] data,
int offset,
int numDigits,
int scale,
char[] buffer)
Converts the specified zoned decimal bytes into a String.
|
public static final java.lang.String bytesToHexString(byte[] data, int offset, int length)
public static final java.lang.String bytesToHexString(byte[] data, int offset, int length, char[] buffer)
public static final byte[] hexStringToBytes(java.lang.String value)
public static final int hexStringToBytes(java.lang.String value, byte[] data, int offset)
public static final byte[] stringToEBCDICByteArray37(java.lang.String s)
public static final int stringToEBCDICByteArray37(java.lang.String s, byte[] data, int offset)
public static final int stringToEBCDICByteArray37(java.lang.String s, int length, byte[] data, int offset)
public static final byte[] stringToEBCDICByteArray(java.lang.String s, int ccsid) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- Thrown if conversion to or from the specified CCSID is not supported.public static final int stringToEBCDICByteArray(java.lang.String s, byte[] data, int offset, int ccsid) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- Thrown if conversion to or from the specified CCSID is not supported.public static final int stringToEBCDICByteArray(java.lang.String s, int length, byte[] data, int offset, int ccsid) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- Thrown if conversion to or from the specified CCSID is not supported.public static final byte[] stringToUnicodeByteArray(java.lang.String s)
public static final int stringToUnicodeByteArray(java.lang.String s, byte[] data, int offset)
public static final int stringToUnicodeByteArray(java.lang.String s, int length, byte[] data, int offset)
public static void stringToUnicodeByteArray(java.lang.String s, byte[] data, int offset, int byteLength)
public static final int stringToUtf8ByteArray(java.lang.String s, int length, byte[] data, int offset)
public static final void stringToBlankPadUnicodeByteArray(java.lang.String s, byte[] data, int offset, int length)
public static final java.lang.String unicodeByteArrayToString(byte[] data, int offset, int length)
public static final java.lang.String unicodeByteArrayToString(byte[] data, int offset, int length, char[] buffer)
public static final void stringToBlankPadEBCDICByteArray(java.lang.String s, byte[] data, int offset, int length)
public static final void stringToBlankPadEBCDICByteArray(java.lang.String s, byte[] data, int offset, int length, int ccsid) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- Thrown if conversion to or from the specified CCSID is not supported.public static final char ebcdicByteToChar(byte b)
public static final java.lang.String ebcdicByteArrayToString(byte[] data, int offset, int length)
public static final java.lang.String ebcdicByteArrayToString(byte[] data, char[] buffer)
public static final java.lang.String ebcdicByteArrayToString(byte[] data, int offset, int length, char[] buffer)
public static final java.lang.String ebcdicByteArrayToString(byte[] data, int offset, int length, int ccsid) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- Thrown if conversion to or from the specified CCSID is not supported.public static final java.lang.String ebcdicByteArrayToString(byte[] data, int offset, int length, char[] buffer, int ccsid) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- Thrown if conversion to or from the specified CCSID is not supported.public static boolean isSupported(int ccsid)
public static final long byteArrayToLong(byte[] data, int offset)
public static final int byteArrayToInt(byte[] data, int offset)
public static final short byteArrayToShort(byte[] data, int offset)
public static final void shortToByteArray(int value, byte[] data, int offset)
public static final byte[] intToByteArray(int value)
public static final void intToByteArray(int value, byte[] data, int offset)
public static final byte[] longToByteArray(long longValue)
public static final void longToByteArray(long longValue, byte[] data, int offset)
public static final byte[] blankPadEBCDIC10(java.lang.String s)
public static final float byteArrayToFloat(byte[] data, int offset)
public static final void floatToByteArray(float f, byte[] data, int offset)
public static final byte[] floatToByteArray(float f)
public static final double byteArrayToDouble(byte[] data, int offset)
public static final void doubleToByteArray(double d, byte[] data, int offset)
public static final byte[] doubleToByteArray(double d)
public static final java.lang.String decfloat16ByteArrayToString(byte[] data, int offset)
public static final java.lang.String decfloat34ByteArrayToString(byte[] data, int offset)
public static final java.lang.String packedDecimalToString(byte[] data, int offset, int numDigits, int scale)
public static final java.lang.String packedDecimalToString(byte[] data, int offset, int numDigits, int scale, char[] buffer)
public static final double packedDecimalToDouble(byte[] data, int offset, int numDigits, int scale)
public static final byte[] doubleToPackedDecimal(double d, int numDigits, int scale)
public static final void doubleToPackedDecimal(double d, byte[] data, int offset, int numDigits, int scale)
public static final byte[] stringToPackedDecimal(java.lang.String s, int numDigits)
public static final void stringToPackedDecimal(java.lang.String s, int numDigits, byte[] buffer, int offset)
public static final java.lang.String zonedDecimalToString(byte[] data, int offset, int numDigits, int scale)
public static final java.lang.String zonedDecimalToString(byte[] data, int offset, int numDigits, int scale, char[] buffer)
public static final long zonedDecimalToLong(byte[] data, int offset, int numDigits)
public static final int zonedDecimalToInt(byte[] data, int offset, int numDigits)
public static final double zonedDecimalToDouble(byte[] data, int offset, int numDigits, int scale)
public static final byte[] doubleToZonedDecimal(double d, int numDigits, int scale)
public static final void doubleToZonedDecimal(double d, byte[] data, int offset, int numDigits, int scale)
public static final void longToZonedDecimal(long l, byte[] data, int offset, int numDigits)
public static final byte[] stringToZonedDecimal(java.lang.String s, int numDigits)
public static final void stringToZonedDecimal(java.lang.String s, int numDigits, byte[] buffer, int offset)
public static java.lang.String getDefaultNLV()