Class FixedSizeObjectSerializer<T>
- java.lang.Object
-
- org.djutils.serialization.serializers.BasicSerializer<T>
-
- org.djutils.serialization.serializers.ObjectSerializer<T>
-
- org.djutils.serialization.serializers.FixedSizeObjectSerializer<T>
-
- Type Parameters:
T
- class
- All Implemented Interfaces:
Serializer<T>
public abstract class FixedSizeObjectSerializer<T> extends ObjectSerializer<T>
Serializer for simple, fixed size, classes.Copyright (c) 2019-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.- Version:
- $Revision$, $LastChangedDate$, by $Author$,
- Author:
- Alexander Verbraeck, Peter Knoppers
-
-
Constructor Summary
Constructors Constructor Description FixedSizeObjectSerializer(byte fieldType, int serializedDataSize, String dataClassName)
Construct the FixedSizeSerializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
size(Object object)
Compute the number of bytes needed to serialize an object of type T (excluding the byte(s) that indicate that an object of type T is next in the data stream).-
Methods inherited from class org.djutils.serialization.serializers.ObjectSerializer
getNumberOfDimensions, serializeWithPrefix, sizeWithPrefix
-
Methods inherited from class org.djutils.serialization.serializers.BasicSerializer
dataClassName, fieldType, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.djutils.serialization.serializers.Serializer
deSerialize, serialize
-
-
-
-
Constructor Detail
-
FixedSizeObjectSerializer
public FixedSizeObjectSerializer(byte fieldType, int serializedDataSize, String dataClassName)
Construct the FixedSizeSerializer.- Parameters:
fieldType
- byte; the field type (returned by thefieldType
method)serializedDataSize
- int; number of bytes required for serialized TdataClassName
- String; returned by the dataClassName method
-
-
Method Detail
-
size
public final int size(Object object)
Description copied from interface:Serializer
Compute the number of bytes needed to serialize an object of type T (excluding the byte(s) that indicate that an object of type T is next in the data stream).- Parameters:
object
- T; Instance of the object- Returns:
- int; the number of bytes needed to serialize an object of type T
-
-