You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ex...@apache.org on 2022/01/07 04:47:29 UTC

[nifi] branch main updated: NIFI-9549: Delegate NonFlushableOutputStream write methods to wrapped OutputStream

This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new d9b863a  NIFI-9549: Delegate NonFlushableOutputStream write methods to wrapped OutputStream
d9b863a is described below

commit d9b863a84bcd60bffd85ab9506484fcd20ff0607
Author: Mark Payne <ma...@hotmail.com>
AuthorDate: Thu Jan 6 16:34:01 2022 -0500

    NIFI-9549: Delegate NonFlushableOutputStream write methods to wrapped OutputStream
    
    Ensure that we delegate calls to write(byte[]) and write(byte[], int, int) to the underlying OutputStream for NonFlushableOutputStream, instead of allowing FilterOutputStream to iterate over every byte
    
    This closes #5642
    
    Signed-off-by: David Handermann <ex...@apache.org>
---
 .../apache/nifi/stream/io/NonFlushableOutputStream.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/stream/io/NonFlushableOutputStream.java b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/stream/io/NonFlushableOutputStream.java
index e951064..335d864 100644
--- a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/stream/io/NonFlushableOutputStream.java
+++ b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/stream/io/NonFlushableOutputStream.java
@@ -34,4 +34,19 @@ public class NonFlushableOutputStream extends FilterOutputStream {
     public void close() throws IOException {
         out.close();
     }
+
+    @Override
+    public void write(final byte[] b, final int off, final int len) throws IOException {
+        out.write(b, off, len);
+    }
+
+    @Override
+    public void write(final byte[] b) throws IOException {
+        out.write(b);
+    }
+
+    @Override
+    public void write(final int b) throws IOException {
+        out.write(b);
+    }
 }