com.ibm.mq.headers
Class CCSID
- java.lang.Object
- com.ibm.mq.headers.CCSID
- public class CCSID
- extends java.lang.Object
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 |
---|---|
|
convert(byte[] bytes,int ccsid)
Deprecated. prefer
Charsets.convert(byte[],int)
|
|
convert(byte[] bytes,int offset,int length,int ccsid)
Deprecated. prefer
Charsets.convert(byte[],int,int,int)
|
|
convert(java.lang.String string,int ccsid)
Deprecated. prefer
Charsets.convert(String,int)
|
|
getCCSIDs()
Returns an enumeration of the CCSID values registered.
|
|
getCodepage(int ccsid)
Returns the codepage name corresponding to the specified CCSID.
|
|
getDecoder(int ccsid)
Returns the Charset Decoder corresponding to the specified CCSID.
|
|
getEncoder(int ccsid)
Returns the Charset Encoder corresponding to the specified CCSID.
|
|
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
- public CCSID()
Method Detail
getJmqiCodepage
- public static com.ibm.mq.jmqi.system.JmqiCodepage getJmqiCodepage( int ccsid)
- 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
- public static java.lang.String getCodepage( int ccsid)
- 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
- public static java.nio.charset.CharsetEncoder getEncoder( int ccsid)
- 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
- public static java.nio.charset.CharsetDecoder getDecoder( int ccsid)
- 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
- public static java.lang.String convert( byte[] bytes,
- int ccsid)
- 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
- public static java.lang.String convert( byte[] bytes,
- int offset,
- int length,
- int ccsid)
- throws java.io.UnsupportedEncodingException
Deprecated. prefer
Charsets.convert(byte[],int,int,int)
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
- public static byte[] convert(java.lang.String string,
- int ccsid)
- 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
- public static java.util.Enumeration getCCSIDs( )
Returns an enumeration of the CCSID values registered. The enumeration values are type Integer.
Returns:
the Enumeration