public abstract class AbstractMarshaller extends Object implements Marshaller
Modifier and Type | Field and Description |
---|---|
protected MarshallableTypeHints |
marshallableTypeHints |
Constructor and Description |
---|
AbstractMarshaller() |
Modifier and Type | Method and Description |
---|---|
BufferSizePredictor |
getBufferSizePredictor(Object o)
Returns a marshalled payload size predictor for a particular type.
|
Object |
objectFromByteBuffer(byte[] buf)
Unmarshalls an object from a byte array.
|
Object |
objectFromInputStream(InputStream inputStream)
This method implements
StreamingMarshaller.objectFromInputStream(java.io.InputStream) , but its
implementation has been moved here rather that keeping under a class that implements StreamingMarshaller
in order to avoid code duplication. |
ByteBuffer |
objectToBuffer(Object obj)
A method that returns an instance of
ByteBuffer , which allows direct access to the byte
array with minimal array copying |
protected abstract ByteBuffer |
objectToBuffer(Object o,
int estimatedSize)
This is a convenience method for converting an object into a
org.infinispan.io.ByteBuffer which takes
an estimated size as parameter. |
byte[] |
objectToByteBuffer(Object o)
Marshalls an object to a byte array.
|
byte[] |
objectToByteBuffer(Object obj,
int estimatedSize)
Marshalls an object to a byte array.
|
isMarshallable, objectFromByteBuffer
protected final MarshallableTypeHints marshallableTypeHints
public BufferSizePredictor getBufferSizePredictor(Object o)
Marshaller
getBufferSizePredictor
in interface Marshaller
o
- Object for which serialized predictor will be returnedBufferSizePredictor
protected abstract ByteBuffer objectToBuffer(Object o, int estimatedSize)
org.infinispan.io.ByteBuffer
which takes
an estimated size as parameter. A org.infinispan.io.ByteBuffer
allows direct access to the byte
array with minimal array copyingo
- object to marshallestimatedSize
- an estimate of how large the resulting byte array may bepublic ByteBuffer objectToBuffer(Object obj)
Marshaller
ByteBuffer
, which allows direct access to the byte
array with minimal array copyingobjectToBuffer
in interface Marshaller
obj
- object to marshallpublic byte[] objectToByteBuffer(Object o)
Marshaller
objectToByteBuffer
in interface Marshaller
o
- object to convert to a byte array. Must not be null.public byte[] objectToByteBuffer(Object obj, int estimatedSize)
Marshaller
objectToByteBuffer
in interface Marshaller
obj
- object to convert to a byte array. Must not be null.estimatedSize
- an estimate of how large the resulting byte array may bepublic Object objectFromByteBuffer(byte[] buf)
Marshaller
objectFromByteBuffer
in interface Marshaller
buf
- byte array containing the binary representation of an object. Must not be null.public Object objectFromInputStream(InputStream inputStream)
StreamingMarshaller.objectFromInputStream(java.io.InputStream)
, but its
implementation has been moved here rather that keeping under a class that implements StreamingMarshaller
in order to avoid code duplication.Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.