de.janrufmonitor.util.io
Class Serializer

java.lang.Object
  extended by de.janrufmonitor.util.io.Serializer

public class Serializer
extends Object

This class provides support for serializing framework objects into String and Stream and vice versa.

Author:
Thilo Brandt

Constructor Summary
Serializer()
           
 
Method Summary
static byte[] toByteArray(ICall call)
          Serializes a call object into an byte array.
static byte[] toByteArray(ICaller caller)
          Serializes a caller object into an byte array.
static ICall toCall(byte[] call, IRuntime runtime)
          Deserializes a byte array stream into an call object.
static ICaller toCaller(byte[] caller, IRuntime runtime)
          Deserializes a byte array stream into an caller object.
static InputStream toInputStream(ICall call)
          Serializes a call object into an inputstream.
static InputStream toInputStream(ICaller caller)
          Serializes a caller object into an inputstream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Serializer

public Serializer()
Method Detail

toByteArray

public static byte[] toByteArray(ICaller caller)
                          throws SerializerException
Serializes a caller object into an byte array.

Parameters:
caller - caller to be serialized
Returns:
serialized byte array
Throws:
SerializerException

toInputStream

public static InputStream toInputStream(ICaller caller)
                                 throws SerializerException
Serializes a caller object into an inputstream.

Parameters:
caller - caller to be serialized
Returns:
serialized inputstream
Throws:
SerializerException

toCaller

public static ICaller toCaller(byte[] caller,
                               IRuntime runtime)
                        throws SerializerException
Deserializes a byte array stream into an caller object.

Parameters:
caller - caller as a byte array representation.
runtime - runtime to used
Returns:
caller object
Throws:
SerializerException

toByteArray

public static byte[] toByteArray(ICall call)
                          throws SerializerException
Serializes a call object into an byte array.

Parameters:
call - call to be serialized
Returns:
serialized byte array
Throws:
SerializerException

toInputStream

public static InputStream toInputStream(ICall call)
                                 throws SerializerException
Serializes a call object into an inputstream.

Parameters:
call - call to be serialized
Returns:
serialized inputstream
Throws:
SerializerException

toCall

public static ICall toCall(byte[] call,
                           IRuntime runtime)
                    throws SerializerException
Deserializes a byte array stream into an call object.

Parameters:
call - call as a byte array representation.
runtime - runtime to used
Returns:
call object
Throws:
SerializerException


Copyright © 2010 by Thilo Brandt. All Rights Reserved.