com.ibm.mq.headers
Class Charsets
- java.lang.Object
-
- com.ibm.mq.jmqi.JmqiObject
-
- com.ibm.mq.headers.Charsets
-
public class Charsets extends com.ibm.mq.jmqi.JmqiObjectClass to do NIO Charset based conversion of data in Headers
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.Stringconvert(byte[] bytes, int ccsid)Converts byte array content in the specified CCSID into a Java String.static java.lang.Stringconvert(byte[] bytes, int ccsid, int encoding)Converts byte array content in the specified CCSID into a Java String.static java.lang.Stringconvert(byte[] bytes, int offset, int length, int ccsid)Converts byte array content in the specified CCSID into a Java String.static java.lang.Stringconvert(byte[] bytes, int offset, int length, int ccsid, int encoding)Converts byte array content in the specified CCSID into a Java String.static java.lang.Stringconvert(java.nio.ByteBuffer bytes, int offset, int length, int ccsid)Converts ByteBuffer content in the specified CCSID into a Java String.static byte[]convert(java.lang.String string, int ccsid)Converts a Java string into a byte array in the specified CCSID.
-
-
-
Method Detail
-
convert
public static java.lang.String convert(byte[] bytes, int ccsid) throws java.io.UnsupportedEncodingExceptionConverts byte array content in the specified CCSID into a Java String.- Parameters:
bytes- The dataccsid- The Coded Character Set ID- Returns:
- The data as a Unicode string
- Throws:
java.io.UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
convert
public static java.lang.String convert(byte[] bytes, int ccsid, int encoding) throws java.io.UnsupportedEncodingExceptionConverts byte array content in the specified CCSID into a Java String.- Parameters:
bytes- The dataccsid- The Coded Character Set IDencoding- The encoding of the header, relevant for CCSID 1200 character encodings- Returns:
- The data as a Java String
- Throws:
java.io.UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
convert
public static java.lang.String convert(byte[] bytes, int offset, int length, int ccsid) throws java.io.UnsupportedEncodingExceptionConverts byte array content in the specified CCSID into a Java String.- Parameters:
bytes-offset-length-ccsid-- Returns:
- the resulting string
- Throws:
java.io.UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
convert
public static java.lang.String convert(byte[] bytes, int offset, int length, int ccsid, int encoding) throws java.io.UnsupportedEncodingExceptionConverts byte array content in the specified CCSID into a Java String.- Parameters:
bytes-offset-length-ccsid-encoding-- Returns:
- the resulting string
- Throws:
java.io.UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
convert
public static java.lang.String convert(java.nio.ByteBuffer bytes, int offset, int length, int ccsid) throws java.io.UnsupportedEncodingExceptionConverts ByteBuffer content in the specified CCSID into a Java String.- Parameters:
bytes-offset-length-ccsid-- Returns:
- the resulting string
- Throws:
java.io.UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
convert
public static byte[] convert(java.lang.String string, int ccsid) throws java.io.UnsupportedEncodingExceptionConverts a Java string into a byte array in the specified CCSID.- Parameters:
string-ccsid-- Returns:
- the resulting byte array
- Throws:
java.io.UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
-