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.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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String convert(byte[] bytes, int ccsid)
      Converts byte array content in the specified CCSID into a Java String.
      static java.lang.String convert(byte[] bytes, int ccsid, int encoding)
      Converts byte array content in the specified CCSID into a Java String.
      static java.lang.String convert(byte[] bytes, int offset, int length, int ccsid)
      Converts byte array content in the specified CCSID into a Java String.
      static java.lang.String convert(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.String convert(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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • convert

        public static java.lang.String convert(byte[] bytes,
                                               int ccsid)
                                        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

        public static java.lang.String convert(byte[] bytes,
                                               int ccsid,
                                               int encoding)
                                        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
        encoding - 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.UnsupportedEncodingException
        Converts 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.UnsupportedEncodingException
        Converts 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.UnsupportedEncodingException
        Converts 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.UnsupportedEncodingException
        Converts 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.
(c) Copyright IBM Corp. 2008, 2016. All Rights Reserved.