com.sibvisions.rad.remote.serializer
Class AbstractSizedSerializer
java.lang.Object
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.
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 |
AbstractSizedSerializer
public AbstractSizedSerializer()
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 streampTypeValue
- type definition with included content lengthpMin
- start value for the type definitionpMax
- 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 streampSize
- length of the contentpMin
- start value for the type definitionpMax
- 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.