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 a741f65dd6d2eb21f1be7fcfd37d5fac52d28777 Author: Benoit Tellier <btell...@linagora.com> AuthorDate: Tue Jun 28 09:40:10 2022 +0700 MIME4J-318 Improve writing recycled buffers --- .../java/org/apache/james/mime4j/message/DefaultMessageWriter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageWriter.java b/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageWriter.java index 5c4c1ce5..9e52c4f5 100644 --- a/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageWriter.java +++ b/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageWriter.java @@ -40,6 +40,7 @@ import org.apache.james.mime4j.util.ByteArrayBuffer; import org.apache.james.mime4j.util.ByteSequence; import org.apache.james.mime4j.util.ContentUtil; import org.apache.james.mime4j.util.MimeUtil; +import org.apache.james.mime4j.util.RecycledByteArrayBuffer; /** * Default implementation of {@link MessageWriter}. @@ -272,6 +273,9 @@ public class DefaultMessageWriter implements MessageWriter { if (byteSequence instanceof ByteArrayBuffer) { ByteArrayBuffer bab = (ByteArrayBuffer) byteSequence; out.write(bab.buffer(), 0, bab.length()); + } else if (byteSequence instanceof RecycledByteArrayBuffer) { + RecycledByteArrayBuffer bab = (RecycledByteArrayBuffer) byteSequence; + out.write(bab.buffer(), 0, bab.length()); } else { out.write(byteSequence.toByteArray()); } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org