X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/382d8d22d0ccad109106b140616638799cc646f6..fc8b6d0fcbedd6a4c9ae394a0640e79690e28337:/src/main/java/org/asamk/signal/JsonWriterImpl.java diff --git a/src/main/java/org/asamk/signal/JsonWriterImpl.java b/src/main/java/org/asamk/signal/JsonWriterImpl.java deleted file mode 100644 index aabf399a..00000000 --- a/src/main/java/org/asamk/signal/JsonWriterImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.asamk.signal; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import org.asamk.signal.util.Util; - -import java.io.IOException; -import java.io.Writer; - -public class JsonWriterImpl implements JsonWriter { - - private final Writer writer; - private final ObjectMapper objectMapper; - - public JsonWriterImpl(final Writer writer) { - this.writer = writer; - this.objectMapper = Util.createJsonObjectMapper(); - } - - public synchronized void write(final Object object) { - try { - try { - objectMapper.writeValue(writer, object); - } catch (JsonProcessingException e) { - // Some issue with json serialization, probably caused by a bug - throw new AssertionError(e); - } - writer.write(System.lineSeparator()); - writer.flush(); - } catch (IOException e) { - throw new AssertionError(e); - } - } -}