com.esotericsoftware.kryo.serialize
Class ByteSerializer

java.lang.Object
  extended by com.esotericsoftware.kryo.Serializer
      extended by com.esotericsoftware.kryo.serialize.ByteSerializer

public class ByteSerializer
extends Serializer

Writes 1 byte.

Author:
Nathan Sweet

Constructor Summary
ByteSerializer()
           
 
Method Summary
static int getUnsigned(java.nio.ByteBuffer buffer)
          Reads a non-negative byte from the buffer that was written with putUnsigned(ByteBuffer, int).
static void putUnsigned(java.nio.ByteBuffer buffer, int value)
          Writes the specified non-negative int to the buffer, cast as a byte.
 java.lang.Byte 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

ByteSerializer

public ByteSerializer()
Method Detail

readObjectData

public java.lang.Byte readObjectData(java.nio.ByteBuffer buffer,
                                     java.lang.Class type)
Description copied from class: Serializer
Reads an object from the buffer.

Specified by:
readObjectData in class Serializer
Returns:
The deserialized object, never null.

writeObjectData

public void writeObjectData(java.nio.ByteBuffer buffer,
                            java.lang.Object object)
Description copied from class: Serializer
Writes the object to the buffer.

Specified by:
writeObjectData in class Serializer
object - Cannot be null.

putUnsigned

public static void putUnsigned(java.nio.ByteBuffer buffer,
                               int value)
Writes the specified non-negative int to the buffer, cast as a byte.


getUnsigned

public static int getUnsigned(java.nio.ByteBuffer buffer)
Reads a non-negative byte from the buffer that was written with putUnsigned(ByteBuffer, int).



Copyright © 2011. All Rights Reserved.