src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicInstantMessaging.java
/**
     * Create a Message instance for sending arbitrary MIME-encoding content.
     *
     * @param content content value
     * @param contentType the MIME-type for <tt>content</tt>
     * @param encoding encoding used for <tt>content</tt>
     * @param subject a <tt>String</tt> subject or <tt>null</tt> for now
     *            subject.
     * @return the newly created message.
     */
Create a Message instance for sending arbitrary MIME-encoding content.
@param content content value
@param contentType the MIME-type for content
@param encoding encoding used for content
@param subject a String subject or null for now
subject.
@return the newly created message.
Create a Message instance for sending arbitrary MIME - encoding content . @param content content value @param contentType the MIME - type for content @param encoding encoding used for content @param subject a String subject or null for now subject . @return the newly created message .
public Message createMessage(byte[] content, String contentType,
        String encoding, String subject)
    {
        String contentAsString = null;
        boolean useDefaultEncoding = true;
        if (encoding != null)
        {
            try
            {
                contentAsString = new String(content, encoding);
                useDefaultEncoding = false;
            }
            catch (UnsupportedEncodingException ex)
            {
                logger.warn("Failed to decode content using encoding "
                    + encoding, ex);
            }
        }
        if (useDefaultEncoding)
        {
            encoding = Charset.defaultCharset().name();
            contentAsString = new String(content);
        }
        return createMessage(contentAsString, contentType, encoding, subject);
    }
public Message createMessage ( byte [ ] content , String contentType , String encoding , String subject ) { String contentAsString = null ; boolean useDefaultEncoding = true ; if ( encoding != null ) { try { contentAsString = new String ( content , encoding ) ; useDefaultEncoding = false ; } catch ( UnsupportedEncodingException ex ) { logger . warn ( "Failed to decode content using encoding " + encoding , ex ) ; } } if ( useDefaultEncoding ) { encoding = Charset . defaultCharset ( ) . name ( ) ; contentAsString = new String ( content ) ; } return createMessage ( contentAsString , contentType , encoding , subject ) ; }
Create a Message instance for sending arbitrary MIME-encoding content.
Create a Message instance for sending arbitrary MIME - encoding content .
// We'll use the default encoding.