public class JsonStreamWriter<T,S> extends java.lang.Object implements SinkWriter<T,S>
T
-values as JSON into a stream of type S
.JsonStreamReader
Constructor and Description |
---|
JsonStreamWriter(java.util.function.Function<S,java.io.Writer> toWriter)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
write(S out,
T value)
Writes the given value, as JSON, to the specified stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
uncheckedWrite
public JsonStreamWriter(java.util.function.Function<S,java.io.Writer> toWriter)
toWriter
- converts a stream of type S
to a Writer
.java.lang.NullPointerException
- if the argument is null
.public void write(S out, T value) throws java.lang.Exception
write
in interface SinkWriter<T,S>
out
- the stream.value
- the object to serialise.java.lang.Exception
- if an error occurs while serialising and writing the
output to the stream.