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>
Serializer for simple, fixed size, classes.
Copyright (c) 2019-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Constructor Summary
ConstructorDescriptionFixedSizeObjectSerializer
(byte fieldType, int serializedDataSize, String dataClassName) Construct the FixedSizeSerializer. -
Method Summary
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 Details
-
FixedSizeObjectSerializer
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 Details
-
size
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
-