|
||||||||||
| 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.ShortSerializer
public class ShortSerializer
Writes a 1-3 byte short.
| Constructor Summary | |
|---|---|
ShortSerializer()
|
|
ShortSerializer(java.lang.Boolean optimizePositive)
|
|
| Method Summary | |
|---|---|
static short |
get(java.nio.ByteBuffer buffer,
boolean optimizePositive)
Reads a short from the buffer that was written with put(ByteBuffer, short, boolean). |
static short |
put(java.nio.ByteBuffer buffer,
short value,
boolean optimizePositive)
Writes the specified short to the buffer as a byte or short depending on the size of the number. |
java.lang.Short |
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 ShortSerializer()
public ShortSerializer(java.lang.Boolean optimizePositive)
optimizePositive - If true, writes 1 byte if 0 <= value <= 254 and 3 bytes otherwise (default). If false, writes 1 byte
if -127 <= value <= 127 and 3 bytes otherwise. If null, 2 bytes are always written.| Method Detail |
|---|
public java.lang.Short 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.
public static short put(java.nio.ByteBuffer buffer,
short value,
boolean optimizePositive)
optimizePositive - If true, writes 1 byte if 0 <= value <= 254 and 3 bytes otherwise. If false, writes 1 byte if -127
<= value <= 127 and 3 bytes otherwise.
public static short get(java.nio.ByteBuffer buffer,
boolean optimizePositive)
put(ByteBuffer, short, boolean).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||