NormalizedNodeOutputStreamWriter should forward flush() 05/14505/4
authorRobert Varga <rovarga@cisco.com>
Mon, 26 Jan 2015 16:22:34 +0000 (17:22 +0100)
committerRobert Varga <rovarga@cisco.com>
Wed, 28 Jan 2015 16:18:59 +0000 (17:18 +0100)
When flush is called, we should cascade it to underlying stream, if it
is a stream. Failure to do so may cause problems with buffering.

Change-Id: I5ee32c3a0bab6aa112dc3c323ea1c4d5c4d5af5c
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java

index ddbc4f5..05858a8 100644 (file)
@@ -177,6 +177,9 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri
 
     @Override
     public void flush() throws IOException {
+        if (output instanceof OutputStream) {
+            ((OutputStream)output).flush();
+        }
     }
 
     private void startNode(final QName qName, byte nodeType) throws IOException {