Package com.opencloud.rhino.cmp.codecs
Interface DatatypeCodec<T>
-
- Type Parameters:
T
- the type of object that is encoded and decoded.
- All Known Implementing Classes:
SimpleDatatypeCodecs.BigDecimalCodec
,SimpleDatatypeCodecs.BigIntegerCodec
,SimpleDatatypeCodecs.BooleanCodec
,SimpleDatatypeCodecs.ByteArrayCodec
,SimpleDatatypeCodecs.ByteCodec
,SimpleDatatypeCodecs.CharacterCodec
,SimpleDatatypeCodecs.DoubleCodec
,SimpleDatatypeCodecs.FloatCodec
,SimpleDatatypeCodecs.IntegerCodec
,SimpleDatatypeCodecs.LongCodec
,SimpleDatatypeCodecs.ShortCodec
,SimpleDatatypeCodecs.StringCodec
,SleeDatatypeCodecs.ActivityContextInterfaceCodec
,SleeDatatypeCodecs.EventContextCodec
,SleeDatatypeCodecs.ProfileLocalObjectCodec
,SleeDatatypeCodecs.SbbLocalObjectCodec
,SleeDatatypeCodecs.TimerIDCodec
public interface DatatypeCodec<T>
Interface defining a datatype codec.
Implementations of this interface must be public (and static, if an inner class) and have a public no-argument constructor.
- Since:
- Rhino 2.4.0
- See Also:
DatatypeCodecType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
decode(DataInput in, ClassLoader cl, DecoderUtils utils)
Decode a value from the given data input stream.void
encode(T value, DataOutput out, EncoderUtils utils)
Encode the specified value to the given data output stream.
-
-
-
Method Detail
-
encode
void encode(T value, DataOutput out, EncoderUtils utils) throws IOException
Encode the specified value to the given data output stream.
- Parameters:
value
- the value to encode. This will never benull
.out
- the data output stream to encode the value to.utils
- additional utility encoding functions that may be useful to the codec.- Throws:
IOException
- if an I/O error occurs.- Since:
- Rhino 2.4.0
-
decode
T decode(DataInput in, ClassLoader cl, DecoderUtils utils) throws IOException
Decode a value from the given data input stream.
- Parameters:
in
- the data input stream to decode the value from.cl
- a classloader which can be used to load classes necessary to decode the value.utils
- additional utility decoding functions that may be useful to the codec.- Returns:
- the decoded value.
- Throws:
IOException
- if an I/O error occurs.- Since:
- Rhino 2.4.0
-
-