public class ByteBufMessageContent extends MessageContent
MessageContent implementation backed by a Netty ByteBuf.| Constructor and Description |
|---|
ByteBufMessageContent(io.netty.buffer.ByteBuf buffer,
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 a singleton iterator that just contains the wrapped
ByteBuf. |
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 ByteBufMessageContent(io.netty.buffer.ByteBuf buffer,
MessageContentEncoding encoding)
public Object getContent()
MessageContentgetContent in class MessageContentpublic Iterator<io.netty.buffer.ByteBuf> getContentChunkIterator(io.netty.buffer.ByteBufAllocator allocator)
ByteBuf.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 OptionalInt size()
MessageContentsize 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.