public class OffloadedBodyFactory
extends java.lang.Object
implements org.apache.james.mime4j.message.BodyFactory
Modifier and Type | Class and Description |
---|---|
static interface |
OffloadedBodyFactory.IStreamTransfer |
static interface |
OffloadedBodyFactory.SizedBody |
Constructor and Description |
---|
OffloadedBodyFactory() |
OffloadedBodyFactory(OffloadedBodyFactory.IStreamTransfer trans) |
Modifier and Type | Method and Description |
---|---|
org.apache.james.mime4j.dom.BinaryBody |
binaryBody(java.io.InputStream is)
Creates a
BinaryBody that holds the content of the given input
stream. |
static OffloadedBodyFactory.IStreamTransfer |
sharedBufferTransfer()
All body parts transfers will use the same shared buffer.
|
org.apache.james.mime4j.dom.TextBody |
textBody(java.io.InputStream is,
java.lang.String mimeCharset)
Creates a
TextBody that holds the content of the given input stream. |
public OffloadedBodyFactory()
public OffloadedBodyFactory(OffloadedBodyFactory.IStreamTransfer trans)
public static OffloadedBodyFactory.IStreamTransfer sharedBufferTransfer()
OffloadedBodyFactory
instance is not shared, it is faster to
use that.public org.apache.james.mime4j.dom.BinaryBody binaryBody(java.io.InputStream is) throws java.io.IOException
BinaryBody
that holds the content of the given input
stream.binaryBody
in interface org.apache.james.mime4j.message.BodyFactory
is
- input stream to create a message body from.java.io.IOException
- if an I/O error occurs.public org.apache.james.mime4j.dom.TextBody textBody(java.io.InputStream is, java.lang.String mimeCharset) throws java.io.IOException
TextBody
that holds the content of the given input stream.
The charset corresponding to the given MIME charset name is used to decode
the byte content of the input stream into a character stream when calling
getReader()
on the returned object. If the MIME
charset has no corresponding Java charset or the Java charset cannot be used
for decoding then "us-ascii" is used instead.
textBody
in interface org.apache.james.mime4j.message.BodyFactory
is
- input stream to create a message body from.mimeCharset
- name of a MIME charset.java.io.IOException
- if an I/O error occurs.Copyright © 2021. All Rights Reserved.