src/main/java/com/github/mikesafonov/smpp/core/sender/MessageBuilder.java
@NotNull
    private SubmitSm createSubmitSm(@NotNull String message, byte esmClass, @NotNull Address sourceAddress, @NotNull Address destAddress, boolean silent, boolean ucs2Only) throws SmppInvalidArgumentException {

        SubmitSm sm = new SubmitSm();
        sm.setEsmClass(esmClass);
        sm.setSourceAddress(sourceAddress);
        sm.setDestAddress(destAddress);
        CountWithEncoding countWithEncoding = MessageUtil.calculateCountSMS(message, ucs2Only);
        byte coding = findCoding(countWithEncoding.getCharset(), silent);
        sm.setDataCoding(coding);
        byte[] messageByte = CharsetUtil.encode(message, countWithEncoding.getCharset());
        if (countWithEncoding.getCount() > 1) {
            sm.setShortMessage(new byte[0]);
            sm.addOptionalParameter(new Tlv(SmppConstants.TAG_MESSAGE_PAYLOAD, messageByte));
        } else {
            sm.setShortMessage(messageByte);
        }
        return sm;
    }
/**
     * Builds {@link SubmitSm} for sending via smpp.
     *
     * @param message       client message
     * @param esmClass      ESM_CLASS, see
     *                      {@link SmppConstants#ESM_CLASS_MM_STORE_FORWARD} /
     *                      {@link SmppConstants#ESM_CLASS_MM_DATAGRAM}
     * @param sourceAddress source address
     * @param destAddress   destination address
     * @return message {@link SubmitSm}.
     * @throws SmppInvalidArgumentException see {@link SubmitSm#setShortMessage}
     */
Builds  SubmitSm for sending via smpp.
Builds SubmitSm for sending via smpp .
@NotNull
    private SubmitSm createSubmitSm(@NotNull String message, byte esmClass, @NotNull Address sourceAddress, @NotNull Address destAddress, boolean silent, boolean ucs2Only) throws SmppInvalidArgumentException {
        SubmitSm sm = new SubmitSm();
        sm.setEsmClass(esmClass);
        sm.setSourceAddress(sourceAddress);
        sm.setDestAddress(destAddress);
        CountWithEncoding countWithEncoding = MessageUtil.calculateCountSMS(message, ucs2Only);
        byte coding = findCoding(countWithEncoding.getCharset(), silent);
        sm.setDataCoding(coding);
        byte[] messageByte = CharsetUtil.encode(message, countWithEncoding.getCharset());
        if (countWithEncoding.getCount() > 1) {
            sm.setShortMessage(new byte[0]);
            sm.addOptionalParameter(new Tlv(SmppConstants.TAG_MESSAGE_PAYLOAD, messageByte));
        } else {
            sm.setShortMessage(messageByte);
        }
        return sm;
    }
@ NotNull private SubmitSm createSubmitSm ( @ NotNull String message , byte esmClass , @ NotNull Address sourceAddress , @ NotNull Address destAddress , boolean silent , boolean ucs2Only ) throws SmppInvalidArgumentException { SubmitSm sm = new SubmitSm ( ) ; sm . setEsmClass ( esmClass ) ; sm . setSourceAddress ( sourceAddress ) ; sm . setDestAddress ( destAddress ) ; CountWithEncoding countWithEncoding = MessageUtil . calculateCountSMS ( message , ucs2Only ) ; byte coding = findCoding ( countWithEncoding . getCharset ( ) , silent ) ; sm . setDataCoding ( coding ) ; byte [ ] messageByte = CharsetUtil . encode ( message , countWithEncoding . getCharset ( ) ) ; if ( countWithEncoding . getCount ( ) > 1 ) { sm . setShortMessage ( new byte [ 0 ] ) ; sm . addOptionalParameter ( new Tlv ( SmppConstants . TAG_MESSAGE_PAYLOAD , messageByte ) ) ; } else { sm . setShortMessage ( messageByte ) ; } return sm ; }
Builds {@link SubmitSm} for sending via smpp.
Builds { @link SubmitSm } for sending via smpp .