public class CharSerializer extends java.lang.Object implements Serializer<java.lang.Character>
Serializer
for Char
type. Simply writes the char value
to a byte buffer.Constructor and Description |
---|
CharSerializer()
No arg constructor
|
CharSerializer(java.lang.ClassLoader classLoader)
Constructor to enable this serializer as a transient one.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Character object,
java.nio.ByteBuffer binary)
Checks if the given instance and serial form
represent the same instance. |
java.lang.Character |
read(java.nio.ByteBuffer binary)
Reconstructs an instance from the given serial form.
|
java.nio.ByteBuffer |
serialize(java.lang.Character object)
Transforms the given instance into its serial form.
|
public CharSerializer()
public CharSerializer(java.lang.ClassLoader classLoader)
Parameter is ignored as Character
is a base java type.
classLoader
- the classloader to useSerializer
public java.nio.ByteBuffer serialize(java.lang.Character object)
serialize
in interface Serializer<java.lang.Character>
object
- the instance to serializepublic java.lang.Character read(java.nio.ByteBuffer binary)
read
in interface Serializer<java.lang.Character>
binary
- the binary representation of the serial formpublic boolean equals(java.lang.Character object, java.nio.ByteBuffer binary)
represent
the same instance.equals
in interface Serializer<java.lang.Character>
object
- the instance to checkbinary
- the serial form to checktrue
if both parameters represent equal instances, false
otherwise