All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.djutils.serialization.serializers.FixedSizeObjectSerializer Maven / Gradle / Ivy

There is a newer version: 2.2.2
Show newest version
package org.djutils.serialization.serializers;

/**
 * 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 * @author Peter Knoppers * @param class */ public abstract class FixedSizeObjectSerializer extends ObjectSerializer { /** Size of the encoded data. */ private final int dataSize; /** * Construct the FixedSizeSerializer. * @param fieldType byte; the field type (returned by the fieldType method) * @param serializedDataSize int; number of bytes required for serialized T * @param dataClassName String; returned by the dataClassName method */ public FixedSizeObjectSerializer(final byte fieldType, final int serializedDataSize, final String dataClassName) { super(fieldType, dataClassName); this.dataSize = serializedDataSize; } @Override public final int size(final Object object) { return this.dataSize; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy