org.eclipse.smila.datamodel.ipc
Class IpcAnyWriter
java.lang.Object
org.eclipse.smila.datamodel.ipc.IpcAnyWriter
public class IpcAnyWriter
- extends java.lang.Object
Utility class for writing Any objects to binary (BON) and JSON.
- Author:
- aweber
|
Field Summary |
static java.lang.String |
ENCODING
Encoding to use for String (de)serialization. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ENCODING
public static final java.lang.String ENCODING
- Encoding to use for String (de)serialization.
- See Also:
- Constant Field Values
IpcAnyWriter
public IpcAnyWriter()
IpcAnyWriter
public IpcAnyWriter(boolean printPretty)
- Parameters:
printPretty - whether JSON output should be formatted.
writeBinaryObject
public byte[] writeBinaryObject(Any any)
throws java.io.IOException
- Parameters:
any - input Any object
- Returns:
- input Any converted to BON
- Throws:
java.io.IOException
writeBinaryStream
public void writeBinaryStream(Any any,
java.io.OutputStream stream)
throws java.io.IOException
- Parameters:
any - inputstream - stream to write the output in BON format.
- Throws:
java.io.IOException
writeJsonObject
public java.lang.String writeJsonObject(Any any)
throws java.io.IOException
- Parameters:
any - input Any object
- Returns:
- input Any converted to JSON
- Throws:
java.io.IOException
writeJsonStream
public void writeJsonStream(Any any,
java.io.OutputStream stream)
throws java.io.IOException
- Parameters:
any - inputstream - stream to write the output as JSON.
- Throws:
java.io.IOException
writeStream
public void writeStream(Any any,
IpcStreamWriter writer)
throws java.io.IOException
- Parameters:
any - inputwriter - writer with an underlying stream to write the ouput to.
- Throws:
java.io.IOException