public class InputStreamMessageContent extends MessageContent
MessageContent implementation backed by an InputStream.| Constructor and Description |
|---|
InputStreamMessageContent(com.google.common.io.ByteSource byteSource,
OptionalInt size,
MessageContentEncoding encoding) |
InputStreamMessageContent(Supplier<InputStream> streamSupplier,
OptionalInt size,
MessageContentEncoding encoding) |
| Modifier and Type | Method and Description |
|---|---|
float |
get8bitCharacterProportion()
Estimates the proportion of characters in this
MessageContent that are eight-bit. |
Object |
getContent()
Gets the raw message content in a form that can be written to a Netty channel.
|
String |
getContentAsString()
Gets the content interpreted as a UTF-8 string.
|
Iterator<io.netty.buffer.ByteBuf> |
getContentChunkIterator(io.netty.buffer.ByteBufAllocator allocator)
Returns an iterator that lazily reads chunks of content from the wrapped stream,
ensuring the last is terminated with CRLF.
|
Object |
getDotStuffedContent()
Gets the message content with dot-stuffing applied in a form that can be written to a Netty channel.
|
MessageContentEncoding |
getEncoding()
Gets the
MessageContentEncoding of the content, indicating whether it
contains eight-bit characters. |
OptionalInt |
size()
The size of the content, used to reject messages for servers that support the SIZE SMTP extension.
|
public InputStreamMessageContent(Supplier<InputStream> streamSupplier, OptionalInt size, MessageContentEncoding encoding)
public InputStreamMessageContent(com.google.common.io.ByteSource byteSource,
OptionalInt size,
MessageContentEncoding encoding)
public OptionalInt size()
MessageContentsize in class MessageContentpublic Object getContent()
MessageContentgetContent in class MessageContentpublic Iterator<io.netty.buffer.ByteBuf> getContentChunkIterator(io.netty.buffer.ByteBufAllocator allocator)
getContentChunkIterator in class MessageContentpublic Object getDotStuffedContent()
MessageContentgetDotStuffedContent in class MessageContentpublic MessageContentEncoding getEncoding()
MessageContentMessageContentEncoding of the content, indicating whether it
contains eight-bit characters.getEncoding in class MessageContentpublic float get8bitCharacterProportion()
MessageContentMessageContent that are eight-bit.
This proportion can be used to calculate whether a message would be more efficient if encoded as quoted-printable or base64.
get8bitCharacterProportion in class MessageContentpublic String getContentAsString()
MessageContentThis is intended for debugging purposes only.
getContentAsString in class MessageContentCopyright © 2018. All rights reserved.