com.sibvisions.rad.remote.serializer
Class AbstractSizedSerializer

java.lang.Object
  extended by com.sibvisions.rad.remote.serializer.AbstractSizedSerializer
Direct Known Subclasses:
ArraySerializer, BeanTypeSerializer, BooleanArraySerializer, ByteArraySerializer, CharArraySerializer, DecimalSerializer, DoubleArraySerializer, FloatArraySerializer, IntArraySerializer, ListSerializer, LongArraySerializer, MapSerializer, ShortArraySerializer, StringSerializer

public abstract class AbstractSizedSerializer
extends Object

The base serializer for objects with size/length.


Constructor Summary
AbstractSizedSerializer()
           
 
Method Summary
 int readSize(DataInputStream pIn, int pTypeValue, int pMin, int pMax)
          Reads the content length based on the type identifier.
 void writeSize(DataOutputStream pOut, int pSize, int pMin, int pMax)
          Writes the type definition which includes the length of the content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSizedSerializer

public AbstractSizedSerializer()
Method Detail

readSize

public int readSize(DataInputStream pIn,
                    int pTypeValue,
                    int pMin,
                    int pMax)
             throws Exception
Reads the content length based on the type identifier.

Parameters:
pIn - input stream
pTypeValue - type definition with included content length
pMin - start value for the type definition
pMax - max value for the type definition
Returns:
content length
Throws:
Exception - if the content length cannot be calculated

writeSize

public void writeSize(DataOutputStream pOut,
                      int pSize,
                      int pMin,
                      int pMax)
               throws Exception
Writes the type definition which includes the length of the content.

Parameters:
pOut - output stream
pSize - length of the content
pMin - start value for the type definition
pMax - max value for the type definition
Throws:
Exception - if it is not possible to write the calculated type definition to the stream


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.