Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/iNPUTmice/Conversations.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xml/TagWriter.java')
-rw-r--r--src/main/java/eu/siacs/conversations/xml/TagWriter.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/xml/TagWriter.java b/src/main/java/eu/siacs/conversations/xml/TagWriter.java
index 4f429377a..5a9f3317c 100644
--- a/src/main/java/eu/siacs/conversations/xml/TagWriter.java
+++ b/src/main/java/eu/siacs/conversations/xml/TagWriter.java
@@ -58,15 +58,20 @@ public class TagWriter {
throw new IOException("output stream was null");
}
outputStream.write("<?xml version='1.0'?>");
- outputStream.flush();
}
- public synchronized void writeTag(Tag tag) throws IOException {
+ public void writeTag(final Tag tag) throws IOException {
+ writeTag(tag, true);
+ }
+
+ public synchronized void writeTag(final Tag tag, final boolean flush) throws IOException {
if (outputStream == null) {
throw new IOException("output stream was null");
}
outputStream.write(tag.toString());
- outputStream.flush();
+ if (flush) {
+ outputStream.flush();
+ }
}
public synchronized void writeElement(Element element) throws IOException {