Class BytesMarshaller
- java.lang.Object
-
- org.apache.activemq.store.kahadb.disk.util.BytesMarshaller
-
- All Implemented Interfaces:
Marshaller<byte[]>
public class BytesMarshaller extends Object implements Marshaller<byte[]>
Implementation of a Marshaller for byte arrays
-
-
Constructor Summary
Constructors Constructor Description BytesMarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
deepCopy(byte[] source)
int
getFixedSize()
boolean
isDeepCopySupported()
byte[]
readPayload(DataInput dataIn)
Read the payload of the object from the DataInput stream.void
writePayload(byte[] data, DataOutput dataOut)
Write the payload of the object to the DataOutput stream.
-
-
-
Method Detail
-
writePayload
public void writePayload(byte[] data, DataOutput dataOut) throws IOException
Description copied from interface:Marshaller
Write the payload of the object to the DataOutput stream.- Specified by:
writePayload
in interfaceMarshaller<byte[]>
- Throws:
IOException
-
readPayload
public byte[] 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<byte[]>
- Returns:
- unmarshalled object
- Throws:
IOException
-
getFixedSize
public int getFixedSize()
- Specified by:
getFixedSize
in interfaceMarshaller<byte[]>
- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
deepCopy
public byte[] deepCopy(byte[] source)
- Specified by:
deepCopy
in interfaceMarshaller<byte[]>
- Returns:
- a deep copy of the source object.
-
isDeepCopySupported
public boolean isDeepCopySupported()
- Specified by:
isDeepCopySupported
in interfaceMarshaller<byte[]>
- Returns:
- true if the
Marshaller.deepCopy(Object)
operations is supported.
-
-