public class GsonMessageWriter extends java.lang.Object implements MessageWriter
| Constructor and Description |
|---|
GsonMessageWriter(java.io.OutputStream outputStream)
Construct a new GsonMessageWriter that will write Messages to the given stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying stream.
|
void |
write(Message message)
Write the given message to the backing output stream.
|
public GsonMessageWriter(java.io.OutputStream outputStream)
outputStream - The output stream.public void write(Message message) throws java.io.IOException
MessageWriterwrite in interface MessageWritermessage - The message to write.java.io.IOException - If there is an exception while writing the message.public void close()
throws java.io.IOException
MessageWriterclose in interface MessageWriterjava.io.IOException - If there is an exception when closing the underlying stream.