Class CCSID
java.lang.Object
com.ibm.mq.headers.CCSID
- Direct Known Subclasses:
CCSID
Utility class for converting between numeric CCSID values defined by
IBM 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringconvert(byte[] bytes, int ccsid) Deprecated.static Stringconvert(byte[] bytes, int offset, int length, int ccsid) Deprecated.static byte[]Deprecated.preferCharsets.convert(String,int)static intReturns the CCSID corresponding to the specified codepage.static Enumerationstatic StringgetCodepage(int ccsid) Returns the codepage name corresponding to the specified CCSID.static CharsetDecodergetDecoder(int ccsid) Returns the Charset Decoder corresponding to the specified CCSID.static CharsetEncodergetEncoder(int ccsid) Returns the Charset Encoder corresponding to the specified CCSID.static com.ibm.mq.jmqi.system.JmqiCodepagegetJmqiCodepage(int ccsid) Returns the JmqiCodepage corresponding to the specified CCSID.
-
Constructor Details
-
CCSID
public CCSID()
-
-
Method Details
-
getJmqiCodepage
public static com.ibm.mq.jmqi.system.JmqiCodepage getJmqiCodepage(int ccsid) throws UnsupportedEncodingException Returns the JmqiCodepage corresponding to the specified CCSID.- Parameters:
ccsid- the Coded Character Set Identifier- Returns:
- the JmqiCodepage
- Throws:
UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID
-
getCodepage
Returns the codepage name corresponding to the specified CCSID.- Parameters:
ccsid- the Coded Character Set Identifier.- Returns:
- the codepage name
- Throws:
UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value
-
getCCSID
Returns the CCSID corresponding to the specified codepage.- Parameters:
codepage- a valid codepage.- Returns:
- the CCSID corresponding to the specified codepage.
- Throws:
UnsupportedEncodingException- if there is no CCSID mapping for the supplied codepage.
-
getEncoder
Returns the Charset Encoder corresponding to the specified CCSID.- Parameters:
ccsid- the Coded Character Set Identifier.- Returns:
- the encoder
- Throws:
UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value
-
getDecoder
Returns the Charset Decoder corresponding to the specified CCSID.- Parameters:
ccsid- the Coded Character Set Identifier.- Returns:
- the decoder
- Throws:
UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value
-
convert
Deprecated.preferCharsets.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:
UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
convert
public static String convert(byte[] bytes, int offset, int length, int ccsid) throws UnsupportedEncodingException Deprecated.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 convertinglength- the number of bytes to convertccsid- the Coded Character Set Identifier.- Returns:
- the string
- Throws:
UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
convert
Deprecated.preferCharsets.convert(String,int)Converts a Java string into a byte array in the specified CCSID.- Parameters:
string- the string to convertccsid- the Coded Character Set Identifier.- Returns:
- the byte array
- Throws:
UnsupportedEncodingException- if there is no codepage mapping for the supplied CCSID value or the platform cannot convert from the codepage.
-
getCCSIDs
- Returns:
- the Enumeration an enumeration of the CCSID values registered. The enumeration values are type Integer.
-
Charsets.convert(byte[],int)