Class FixedSizeObjectSerializer<T>

  • Type Parameters:
    T - class
    All Implemented Interfaces:

    public abstract class FixedSizeObjectSerializer<T>
    extends ObjectSerializer<T>
    Serializer for simple, fixed size, classes.

    Copyright (c) 2019-2021 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See DJUTILS License.

    $Revision$, $LastChangedDate$, by $Author$,
    Alexander Verbraeck, Peter Knoppers
    • Constructor Detail

      • FixedSizeObjectSerializer

        public FixedSizeObjectSerializer​(byte fieldType,
                                         int serializedDataSize,
                                         String dataClassName)
        Construct the FixedSizeSerializer.
        fieldType - byte; the field type (returned by the fieldType method)
        serializedDataSize - int; number of bytes required for serialized T
        dataClassName - 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).
        object - T; Instance of the object
        int; the number of bytes needed to serialize an object of type T