org.eclipse.smila.datamodel.ipc
Class IpcRecordWriter
java.lang.Object
org.eclipse.smila.datamodel.ipc.IpcRecordWriter
public class IpcRecordWriter
- extends java.lang.Object
Utility class for writing Record objects to binary (BON) and JSON.
- Author:
- aweber
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IpcRecordWriter
public IpcRecordWriter()
IpcRecordWriter
public IpcRecordWriter(boolean printPretty)
- Parameters:
printPretty
- whether JSON output should be formatted.
writeBinaryObject
public byte[] writeBinaryObject(Record record)
throws java.io.IOException
- Parameters:
record
- input Record object
- Returns:
- input Record converted to BON
- Throws:
java.io.IOException
writeBinaryStream
public void writeBinaryStream(Record record,
java.io.OutputStream stream)
throws java.io.IOException
- Parameters:
record
- input Record objectstream
- stream to write the output in BON format.
- Throws:
java.io.IOException
writeJsonObject
public java.lang.String writeJsonObject(Record record)
throws java.io.IOException
- Parameters:
record
- input Record object
- Returns:
- input Record converted to JSON
- Throws:
java.io.IOException
writeJsonStream
public void writeJsonStream(Record record,
java.io.OutputStream stream)
throws java.io.IOException
- Parameters:
record
- input Record objectstream
- stream to write the output as JSON.
- Throws:
java.io.IOException
writeStream
public void writeStream(Record record,
IpcStreamWriter writer)
throws java.io.IOException
- Parameters:
record
- input Record objectwriter
- writer with an underlying stream to write the ouput to.
- Throws:
java.io.IOException