SMILA 1.0 API documentation

org.eclipse.smila.ipc.util
Class Ipc2BonTrafo

java.lang.Object
  extended by org.eclipse.smila.ipc.util.Ipc2BonTrafo

public class Ipc2BonTrafo
extends java.lang.Object

Transforms IPC input stream (e.g. JSON) to binary (BON) output stream. The incoming stream can be validated by a given Validator implementation.

Author:
aweber

Constructor Summary
Ipc2BonTrafo()
          constructor without Validator.
Ipc2BonTrafo(IpcValidator validator)
           
 
Method Summary
 void ipc2bon(IpcStreamReader ipcReader, BinaryStreamWriter bonWriter)
          Writes an ipc input stream (e.g.
 void json2bon(java.io.InputStream input, java.io.OutputStream output)
          Writes an JSON input stream to a binary (BON) output stream.
 void validateBon(byte[] input)
          Validates a BON object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ipc2BonTrafo

public Ipc2BonTrafo()
constructor without Validator.


Ipc2BonTrafo

public Ipc2BonTrafo(IpcValidator validator)
Parameters:
validator - used to validate the input JSON.
Method Detail

json2bon

public void json2bon(java.io.InputStream input,
                     java.io.OutputStream output)
              throws java.io.IOException
Writes an JSON input stream to a binary (BON) output stream.

Parameters:
input - the (JSON) input stream
output - the (BON) output stream
Throws:
java.io.IOException - conversion error

validateBon

public void validateBon(byte[] input)
                 throws java.io.IOException
Validates a BON object.

Parameters:
input - the BON input stream
Throws:
java.io.IOException - validation error

ipc2bon

public void ipc2bon(IpcStreamReader ipcReader,
                    BinaryStreamWriter bonWriter)
             throws java.io.IOException
Writes an ipc input stream (e.g. JSON) to a binary (BON) output stream.

Parameters:
ipcReader - contains the input stream
bonWriter - contains the output stream
Throws:
java.io.IOException - conversion error

SMILA 1.0 API documentation