dom/src/main/java/org/apache/james/mime4j/dom/Message.java [400:416]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public Builder setBody(String text, String subtype, Charset charset) throws IOException {
            String mimeType = "text/" + (subtype != null ? subtype : "plain");
            if (charset != null) {
                setField(Fields.contentType(mimeType, new NameValuePair("charset", charset.name())));
            } else {
                setField(Fields.contentType(mimeType));
            }
            Body textBody;
            if (bodyFactory != null) {
                textBody = bodyFactory.textBody(
                    InputStreams.create(text, charset),
                    charset != null ? charset.name() : null);
            } else {
                textBody = BasicBodyFactory.INSTANCE.textBody(text, charset);
            }
            return setBody(textBody);
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



dom/src/main/java/org/apache/james/mime4j/message/BodyPartBuilder.java [171:187]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public BodyPartBuilder setBody(String text, String subtype, Charset charset) throws IOException {
        String mimeType = "text/" + (subtype != null ? subtype : "plain");
        if (charset != null) {
            setField(Fields.contentType(mimeType, new NameValuePair("charset", charset.name())));
        } else {
            setField(Fields.contentType(mimeType));
        }
        Body textBody;
        if (bodyFactory != null) {
            textBody = bodyFactory.textBody(
                    InputStreams.create(text, charset),
                    charset != null ? charset.name() : null);
        } else {
            textBody = BasicBodyFactory.INSTANCE.textBody(text, charset);
        }
        return setBody(textBody);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



