com.jfirer.fse.serializer.base.FloatSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Fse Show documentation
Show all versions of Fse Show documentation
a high speed serilaize library
The newest version!
package com.jfirer.fse.serializer.base;
import com.jfirer.fse.*;
public class FloatSerializer extends CycleFlagSerializer implements FseSerializer
{
@Override
public void init(Class> type, SerializerFactory serializerFactory)
{
}
@Override
public void writeToBytes(Object o, int classIndex, InternalByteArray byteArray, FseContext fseContext, int depth)
{
byteArray.writeVarInt(classIndex);
byteArray.writeFloat((Float) o);
}
@Override
public Object readBytes(InternalByteArray byteArray, FseContext fseContext)
{
return byteArray.readFloat();
}
}