|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esotericsoftware.kryo.Serializer
com.esotericsoftware.kryo.serialize.FloatSerializer
public class FloatSerializer
Writes a 1-5 byte float.
| Constructor Summary | |
|---|---|
FloatSerializer()
Creates a FloatSerializer that allows uses 4 bytes to represent a float, with no loss of precision. |
|
FloatSerializer(float precision,
boolean optimizePositive)
Creates a FloatSerializer that allows uses 1-5 bytes to represent a float, with a loss of precision. |
|
| Method Summary | |
|---|---|
java.lang.Float |
readObjectData(java.nio.ByteBuffer buffer,
java.lang.Class type)
Reads an object from the buffer. |
void |
writeObjectData(java.nio.ByteBuffer buffer,
java.lang.Object object)
Writes the object to the buffer. |
| Methods inherited from class com.esotericsoftware.kryo.Serializer |
|---|
isFinal, newInstance, readObject, setCanBeNull, writeObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FloatSerializer()
public FloatSerializer(float precision,
boolean optimizePositive)
IntSerializer. IntSerializer uses 1-4 bytes from
0 to 268,435,455 with "optimize positive" and -134,217,728 to 134,217,727 without. If a float multiplied by the precision
would fall outside these values, it will take 5 bytes to serialize and it may be better to use the other FloatSerializer
constructor.
| Method Detail |
|---|
public java.lang.Float readObjectData(java.nio.ByteBuffer buffer,
java.lang.Class type)
Serializer
readObjectData in class Serializer
public void writeObjectData(java.nio.ByteBuffer buffer,
java.lang.Object object)
Serializer
writeObjectData in class Serializerobject - Cannot be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||