This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-mime4j.git
commit 3b3f09e3b45cb3a090855145dbfe315e11d409c0 Author: Benoit Tellier <btell...@linagora.com> AuthorDate: Wed Jun 29 08:35:44 2022 +0700 MIME4J-318 Improve writing bodies into an output stream --- .../james/mime4j/message/BasicBodyFactory.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dom/src/main/java/org/apache/james/mime4j/message/BasicBodyFactory.java b/dom/src/main/java/org/apache/james/mime4j/message/BasicBodyFactory.java index 225ec295..7470dc7b 100644 --- a/dom/src/main/java/org/apache/james/mime4j/message/BasicBodyFactory.java +++ b/dom/src/main/java/org/apache/james/mime4j/message/BasicBodyFactory.java @@ -22,6 +22,7 @@ package org.apache.james.mime4j.message; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.OutputStream; import java.io.Reader; import java.io.StringReader; import java.io.UnsupportedEncodingException; @@ -220,6 +221,11 @@ public class BasicBodyFactory implements BodyFactory { return InputStreams.create(this.content); } + @Override + public void writeTo(OutputStream out) throws IOException { + out.write(content); + } + @Override public void dispose() { } @@ -262,6 +268,11 @@ public class BasicBodyFactory implements BodyFactory { return this.content.getValue().toInputStream(); } + @Override + public void writeTo(OutputStream out) throws IOException { + content.getValue().writeTo(out); + } + @Override public void dispose() { this.content.release(); @@ -288,6 +299,11 @@ public class BasicBodyFactory implements BodyFactory { return InputStreams.create(this.content); } + @Override + public void writeTo(OutputStream out) throws IOException { + out.write(content); + } + @Override public void dispose() { } @@ -313,6 +329,11 @@ public class BasicBodyFactory implements BodyFactory { return content.getValue().toInputStream(); } + @Override + public void writeTo(OutputStream out) throws IOException { + content.getValue().writeTo(out); + } + @Override public void dispose() { content.release(); --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org