synergynetframework.appsystem.services.net.objectmessaging.utility.serializers
Class ByteSerializer

java.lang.Object
  extended by synergynetframework.appsystem.services.net.objectmessaging.utility.serializers.Serializer
      extended by synergynetframework.appsystem.services.net.objectmessaging.utility.serializers.ByteSerializer

public class ByteSerializer
extends Serializer

The Class ByteSerializer.


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(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Class type, boolean lengthKnown)
          Read object data.
 void writeObjectData(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Object object, boolean lengthKnown)
          Write object data.
 
Methods inherited from class synergynetframework.appsystem.services.net.objectmessaging.utility.serializers.Serializer
newInstance, readNull, readObject, readObjectData, setCanBeNull, writeNull, writeObject, writeObjectData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteSerializer

public ByteSerializer()
Method Detail

getUnsigned

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

Parameters:
buffer - the buffer
Returns:
the unsigned

putUnsigned

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

Parameters:
buffer - the buffer
value - the value

readObjectData

public java.lang.Byte readObjectData(ConnectionHandler connectionHandler,
                                     java.nio.ByteBuffer buffer,
                                     java.lang.Class type,
                                     boolean lengthKnown)
                              throws SerializationException
Description copied from class: Serializer
Read object data.

Specified by:
readObjectData in class Serializer
Parameters:
connectionHandler - the connection handler
buffer - the buffer
type - the type
lengthKnown - the length known
Returns:
the t
Throws:
SerializationException - the serialization exception

writeObjectData

public void writeObjectData(ConnectionHandler connectionHandler,
                            java.nio.ByteBuffer buffer,
                            java.lang.Object object,
                            boolean lengthKnown)
                     throws SerializationException
Description copied from class: Serializer
Write object data.

Specified by:
writeObjectData in class Serializer
Parameters:
connectionHandler - the connection handler
buffer - the buffer
object - the object
lengthKnown - the length known
Throws:
SerializationException - the serialization exception