Class CharConversion
java.lang.Object
com.ibm.dtfj.corereaders.zos.util.CharConversion
This class provides some handy character conversion methods
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Convert the given String to ebcdic bytesstatic String
getEbcdicString
(byte[] buf) Convert an array of ebcdic bytes to a Stringstatic String
getEbcdicString
(byte[] buf, int offset, int length) Convert an array of ebcdic bytes to a Stringstatic byte[]
nullTerminate
(byte[] buf) Null terminates the given array.
-
Constructor Details
-
CharConversion
public CharConversion()
-
-
Method Details
-
getEbcdicBytes
Convert the given String to ebcdic bytes- Parameters:
s
- the String to be converted- Returns:
- the ebcdic byte array
-
getEbcdicString
Convert an array of ebcdic bytes to a String- Parameters:
buf
- the array of ebcdic bytesoffset
- the offset within the array where the bytes to be converted startlength
- the number of bytes to convert- Returns:
- the converted String
-
getEbcdicString
Convert an array of ebcdic bytes to a String- Parameters:
buf
- the array of ebcdic bytes- Returns:
- the converted String
-
nullTerminate
public static byte[] nullTerminate(byte[] buf) Null terminates the given array.- Parameters:
buf
- the array to be null terminated- Returns:
- a copy of the array but with an extra zero byte at the end
-