Class IntegerMarshaller
- java.lang.Object
-
- org.apache.activemq.store.kahadb.disk.util.IntegerMarshaller
-
- All Implemented Interfaces:
Marshaller<Integer>
public class IntegerMarshaller extends Object implements Marshaller<Integer>
Implementation of a Marshaller for a Integer
-
-
Field Summary
Fields Modifier and Type Field Description static IntegerMarshaller
INSTANCE
-
Constructor Summary
Constructors Constructor Description IntegerMarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
deepCopy(Integer source)
int
getFixedSize()
boolean
isDeepCopySupported()
Integer
readPayload(DataInput dataIn)
Read the payload of the object from the DataInput stream.void
writePayload(Integer object, DataOutput dataOut)
Write the payload of the object to the DataOutput stream.
-
-
-
Field Detail
-
INSTANCE
public static final IntegerMarshaller INSTANCE
-
-
Method Detail
-
writePayload
public void writePayload(Integer object, DataOutput dataOut) throws IOException
Description copied from interface:Marshaller
Write the payload of the object to the DataOutput stream.- Specified by:
writePayload
in interfaceMarshaller<Integer>
- Throws:
IOException
-
readPayload
public Integer readPayload(DataInput dataIn) throws IOException
Description copied from interface:Marshaller
Read the payload of the object from the DataInput stream.- Specified by:
readPayload
in interfaceMarshaller<Integer>
- Returns:
- unmarshalled object
- Throws:
IOException
-
getFixedSize
public int getFixedSize()
- Specified by:
getFixedSize
in interfaceMarshaller<Integer>
- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
deepCopy
public Integer deepCopy(Integer source)
- Specified by:
deepCopy
in interfaceMarshaller<Integer>
- Returns:
- the source object since integers are immutable.
-
isDeepCopySupported
public boolean isDeepCopySupported()
- Specified by:
isDeepCopySupported
in interfaceMarshaller<Integer>
- Returns:
- true if the
Marshaller.deepCopy(Object)
operations is supported.
-
-