com.ibm.mq.headers

Class CCSID

  1. java.lang.Object
  2. extended bycom.ibm.mq.headers.CCSID

  1. public class CCSID
  2. extends java.lang.Object
Utility class for converting between numeric CCSID values defined by WebSphere MQ; codepage names known by the operating system and used by Java for character conversion; charsets used by Java for character conversion.

This is basically now a wrapper for JmqiCodepage...

Note: Since all Java strings are Unicode, it is never possible to have a string in an alien codepage. The interactions supported by this class are always conversions between Java strings and byte arrays, which can contain data representing strings in any codepage.

Note: All operations are provided by static methods. No instance of CCSID can be created.


Constructor Summary

Constructor and Description
CCSID()

Method Summary

Modifier and Type Method and Description
  1. static
  2. java.lang.String
convert(byte[] bytes,int ccsid)
Deprecated. prefer Charsets.convert(byte[],int)
  1. static
  2. java.lang.String
convert(byte[] bytes,int offset,int length,int ccsid)
  1. static
  2. byte[]
convert(java.lang.String string,int ccsid)
Deprecated. prefer Charsets.convert(String,int)
  1. static
  2. java.util.Enumeration
getCCSIDs()
Returns an enumeration of the CCSID values registered.
  1. static
  2. java.lang.String
getCodepage(int ccsid)
Returns the codepage name corresponding to the specified CCSID.
  1. static
  2. java.nio.charset.CharsetDecoder
getDecoder(int ccsid)
Returns the Charset Decoder corresponding to the specified CCSID.
  1. static
  2. java.nio.charset.CharsetEncoder
getEncoder(int ccsid)
Returns the Charset Encoder corresponding to the specified CCSID.
  1. static
  2. com.ibm.mq.jmqi.system.JmqiCodepage
getJmqiCodepage(int ccsid)
Returns the JmqiCodepage corresponding to the specified CCSID.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CCSID

  1. public CCSID()

Method Detail

getJmqiCodepage

  1. public static com.ibm.mq.jmqi.system.JmqiCodepage getJmqiCodepage( int ccsid)
  2. throws java.io.UnsupportedEncodingException
Returns the JmqiCodepage corresponding to the specified CCSID.
Parameters:
ccsid - the Coded Character Set Identifier
Returns:
the JmqiCodepage
Throws:
java.io.UnsupportedEncodingException - if there is no codepage mapping for the supplied CCSID

getCodepage

  1. public static java.lang.String getCodepage( int ccsid)
  2. throws java.io.UnsupportedEncodingException
Returns the codepage name corresponding to the specified CCSID.
Parameters:
ccsid - the Coded Character Set Identifier.
Returns:
the codepage name
Throws:
java.io.UnsupportedEncodingException - if there is no codepage mapping for the supplied CCSID value

getEncoder

  1. public static java.nio.charset.CharsetEncoder getEncoder( int ccsid)
  2. throws java.io.UnsupportedEncodingException
Returns the Charset Encoder corresponding to the specified CCSID.
Parameters:
ccsid - the Coded Character Set Identifier.
Returns:
the encoder
Throws:
java.io.UnsupportedEncodingException - if there is no codepage mapping for the supplied CCSID value

getDecoder

  1. public static java.nio.charset.CharsetDecoder getDecoder( int ccsid)
  2. throws java.io.UnsupportedEncodingException
Returns the Charset Decoder corresponding to the specified CCSID.
Parameters:
ccsid - the Coded Character Set Identifier.
Returns:
the decoder
Throws:
java.io.UnsupportedEncodingException - if there is no codepage mapping for the supplied CCSID value

convert

  1. public static java.lang.String convert( byte[] bytes,
  2. int ccsid)
  3. throws java.io.UnsupportedEncodingException
Deprecated. prefer Charsets.convert(byte[],int)
Converts byte array content in the specified CCSID into a Java String.
Parameters:
bytes - the byte array to convert.
ccsid - the Coded Character Set Identifier.
Returns:
the 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.
Parameters:
bytes - the byte array to convert.
offset - the offset in the array at which to start converting
length - the number of bytes to convert
ccsid - the Coded Character Set Identifier.
Returns:
the 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
Deprecated. prefer Charsets.convert(String,int)
Converts a Java string into a byte array in the specified CCSID.
Parameters:
ccsid - the Coded Character Set Identifier.
string - the string to convert
Returns:
the 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.

getCCSIDs

  1. public static java.util.Enumeration getCCSIDs( )
Returns an enumeration of the CCSID values registered. The enumeration values are type Integer.
Returns:
the Enumeration