com.ibm.mq.headers

Class Charsets

  1. java.lang.Object
  2. extended bycom.ibm.mq.jmqi.JmqiObject
  3. extended bycom.ibm.mq.headers.Charsets

  1. public class Charsets
  2. extends com.ibm.mq.jmqi.JmqiObject
Class to do NIO Charset based conversion of data in Headers

Field Summary

Fields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JO

Method Summary

Modifier and Type Method and Description
  1. static
  2. java.lang.String
convert(byte[] bytes,int ccsid)
Converts byte array content in the specified CCSID into a Java String.
  1. static
  2. java.lang.String
convert(byte[] bytes,int offset,int length,int ccsid)
Converts byte array content in the specified CCSID into a Java String.
  1. static
  2. java.lang.String
convert(java.nio.ByteBuffer bytes,int offset,int length,int ccsid)
Converts ByteBuffer content in the specified CCSID into a Java String.
  1. static
  2. byte[]
convert(java.lang.String string,int ccsid)
Converts a Java string into a byte array in the specified CCSID.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

convert

  1. public static java.lang.String convert( byte[] bytes,
  2. int ccsid)
  3. throws java.io.UnsupportedEncodingException
Converts byte array content in the specified CCSID into a Java String.
Parameters:
bytes - The data
ccsid - 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

  1. public static java.lang.String convert( byte[] bytes,
  2. int offset,
  3. int length,
  4. int ccsid)
  5. throws java.io.UnsupportedEncodingException
Converts byte array content in the specified CCSID into 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

  1. public static java.lang.String convert( java.nio.ByteBuffer bytes,
  2. int offset,
  3. int length,
  4. int ccsid)
  5. throws java.io.UnsupportedEncodingException
Converts ByteBuffer content in the specified CCSID into 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

  1. public static byte[] convert(java.lang.String string,
  2. int ccsid)
  3. throws java.io.UnsupportedEncodingException
Converts a Java string into a byte array in the specified CCSID.
Throws:
java.io.UnsupportedEncodingException - if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.