com.sibvisions.rad.remote.serializer
Class ArraySerializer

java.lang.Object
  extended by com.sibvisions.rad.remote.serializer.AbstractSizedSerializer
      extended by com.sibvisions.rad.remote.serializer.ArraySerializer
All Implemented Interfaces:
ITypeSerializer<Object[]>

public class ArraySerializer
extends AbstractSizedSerializer
implements ITypeSerializer<Object[]>

The serializer for any kind of array.


Constructor Summary
ArraySerializer()
           
 
Method Summary
 int getMaxValue()
          Gets the maximal value used to detect this type in stream.
 int getMinValue()
          Gets the minimal value used to detect this type in stream.
 Class<Object[]> getTypeClass()
          Gets the type class that can be serialized by this serializer.
 Object[] read(UniversalSerializer pSerializer, DataInputStream pIn, int pTypeValue, TypeCache pCache)
          Reads in a serialized object from a stream.
 void write(UniversalSerializer pSerializer, DataOutputStream pOut, Object[] pObject, TypeCache pCache)
          Writes a serialized object to a stream.
 
Methods inherited from class com.sibvisions.rad.remote.serializer.AbstractSizedSerializer
readSize, writeSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArraySerializer

public ArraySerializer()
Method Detail

getTypeClass

public Class<Object[]> getTypeClass()
Gets the type class that can be serialized by this serializer.

Specified by:
getTypeClass in interface ITypeSerializer<Object[]>
Returns:
the type class.

getMinValue

public int getMinValue()
Gets the minimal value used to detect this type in stream.

Specified by:
getMinValue in interface ITypeSerializer<Object[]>
Returns:
the minimal value used to detect this type in stream.

getMaxValue

public int getMaxValue()
Gets the maximal value used to detect this type in stream.

Specified by:
getMaxValue in interface ITypeSerializer<Object[]>
Returns:
the maximal value used to detect this type in stream.

read

public Object[] read(UniversalSerializer pSerializer,
                     DataInputStream pIn,
                     int pTypeValue,
                     TypeCache pCache)
              throws Exception
Reads in a serialized object from a stream.

Specified by:
read in interface ITypeSerializer<Object[]>
Parameters:
pSerializer - the universal serializer.
pIn - stream with serialized content
pTypeValue - type value.
pCache - the cache for BeanType definitions
Returns:
deserialized object
Throws:
Exception - if deserialization fails

write

public void write(UniversalSerializer pSerializer,
                  DataOutputStream pOut,
                  Object[] pObject,
                  TypeCache pCache)
           throws Exception
Writes a serialized object to a stream.

Specified by:
write in interface ITypeSerializer<Object[]>
Parameters:
pSerializer - the universal serializer.
pOut - output stream for the object
pObject - serializable object
pCache - the cache for BeanType definitions
Throws:
Exception - if serialization fails


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.