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