You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Benoit Tellier (Jira)" <mi...@james.apache.org> on 2021/04/16 03:15:00 UTC
[jira] [Reopened] (MIME4J-268) Helper method for message to bytes
convertion
[ https://issues.apache.org/jira/browse/MIME4J-268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benoit Tellier reopened MIME4J-268:
-----------------------------------
> Helper method for message to bytes convertion
> ---------------------------------------------
>
> Key: MIME4J-268
> URL: https://issues.apache.org/jira/browse/MIME4J-268
> Project: James Mime4j
> Issue Type: New Feature
> Components: dom
> Reporter: Benoit Tellier
> Priority: Major
>
> Current code looks like this:
> {code:java}
> public byte[] asBytes(Message message) throws IOException {
> ByteArrayOutputStream buffer = new ByteArrayOutputStream();
> DefaultMessageWriter writer = new DefaultMessageWriter();
> writer.writeMessage(message, buffer);
> return buffer.toByteArray();
> }
> {code}
> This is rather complicated for clients. I would propose to introduce that helper method in *DefaultMessageWriter*.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)