static public DataCoding createMessageClassGroup(byte characterEncoding, byte messageClass) throws IllegalArgumentException {
        // only default or 8bit are valid
        if (!(characterEncoding == CHAR_ENC_DEFAULT || characterEncoding == CHAR_ENC_8BIT)) {
            throw new IllegalArgumentException("Invalid characterEncoding [0x" + HexUtil.toHexString(characterEncoding) + "] value used: only default or 8bit supported for message class group");
        }
        // validate the message class
        if (messageClass < 0 || messageClass > 3) {
            throw new IllegalArgumentException("Invalid messageClass [0x" + HexUtil.toHexString(messageClass) + "] value used: 0x00-0x03 only valid range");
        }

        // need to build this dcs value (top 4 bits are 1, start with 0xF0)
        byte dcs = (byte)0xF0;

        // 8bit encoding means bit 2 goes on
        if (characterEncoding == CHAR_ENC_8BIT) {
            dcs |= (byte)0x04;
        }

        // merge in the message class (bottom 2 bits)
        dcs |= messageClass;

        return new DataCoding(dcs, Group.MESSAGE_CLASS, characterEncoding, messageClass, false);
    }
static public DataCoding createMessageClassGroup ( byte characterEncoding , byte messageClass ) throws IllegalArgumentException { if ( ! ( characterEncoding == CHAR_ENC_DEFAULT || characterEncoding == CHAR_ENC_8BIT ) ) { throw new IllegalArgumentException ( "Invalid characterEncoding [0x" + HexUtil . toHexString ( characterEncoding ) + "] value used: only default or 8bit supported for message class group" ) ; } if ( messageClass < 0 || messageClass > 3 ) { throw new IllegalArgumentException ( "Invalid messageClass [0x" + HexUtil . toHexString ( messageClass ) + "] value used: 0x00-0x03 only valid range" ) ; } byte dcs = ( byte ) 0xF0 ; if ( characterEncoding == CHAR_ENC_8BIT ) { dcs |= ( byte ) 0x04 ; } dcs |= messageClass ; return new DataCoding ( dcs , Group . MESSAGE_CLASS , characterEncoding , messageClass , false ) ; }
Creates a "Message Class" group data coding scheme where 2 different
languages are supported (8BIT or DEFAULT).  This method validates the
message class.
@param characterEncoding Either CHAR_ENC_DEFAULT or CHAR_ENC_8BIT
@param messageClass The 4 different possible message classes (0-3)
@return A new immutable DataCoding instance representing this data coding scheme
@throws IllegalArgumentException Thrown if the range is not supported.