diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-22 20:14:02 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-22 20:49:04 +0100 |
commit | 696a54b5f286679d7b77e47c1fedcff0f3c4e259 (patch) | |
tree | 3bbdc8ae670d60003699c971e1b5c13f02982908 /src/main/java/de | |
parent | 3d306a4acdefa46c83717e27214d39ab7e9b5b22 (diff) |
synchronize modifications of output stream in tag writer
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/xml/TagWriter.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/xml/TagWriter.java b/src/main/java/de/pixart/messenger/xml/TagWriter.java index 699e527fa..7c25fdf4a 100644 --- a/src/main/java/de/pixart/messenger/xml/TagWriter.java +++ b/src/main/java/de/pixart/messenger/xml/TagWriter.java @@ -38,7 +38,7 @@ public class TagWriter { public TagWriter() { } - public void setOutputStream(OutputStream out) throws IOException { + public synchronized void setOutputStream(OutputStream out) throws IOException { if (out == null) { throw new IOException(); } @@ -54,7 +54,7 @@ public class TagWriter { return this; } - public TagWriter writeTag(Tag tag) throws IOException { + public synchronized TagWriter writeTag(Tag tag) throws IOException { if (outputStream == null) { throw new IOException("output stream was null"); } @@ -63,7 +63,7 @@ public class TagWriter { return this; } - public TagWriter writeElement(Element element) throws IOException { + public synchronized TagWriter writeElement(Element element) throws IOException { if (outputStream == null) { throw new IOException("output stream was null"); } @@ -101,7 +101,7 @@ public class TagWriter { return outputStream != null; } - public void forceClose() { + public synchronized void forceClose() { finish(); if (outputStream != null) { try { |