Package org.infinispan.commons.marshall
Class IdentityMarshaller
java.lang.Object
org.infinispan.commons.marshall.AbstractMarshaller
org.infinispan.commons.marshall.IdentityMarshaller
- All Implemented Interfaces:
Marshaller
A marshaller that does not transform the content, only applicable to byte[] payloads.
- Since:
- 9.3
-
Field Summary
FieldsFields inherited from class org.infinispan.commons.marshall.AbstractMarshaller
marshallableTypeHints -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanA method that checks whether the given object is marshallable as per the rules of this marshaller.objectFromByteBuffer(byte[] buf, int offset, int length) Unmarshalls an object from a specific portion of a byte array.protected ByteBufferobjectToBuffer(Object o, int estimatedSize) This is a convenience method for converting an object into aByteBufferwhich takes an estimated size as parameter.Methods inherited from class org.infinispan.commons.marshall.AbstractMarshaller
getBufferSizePredictor, objectFromByteBuffer, objectFromInputStream, objectToBuffer, objectToByteBuffer, objectToByteBufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.commons.marshall.Marshaller
initialize, start, stop
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
IdentityMarshaller
public IdentityMarshaller()
-
-
Method Details
-
objectToBuffer
Description copied from class:AbstractMarshallerThis is a convenience method for converting an object into aByteBufferwhich takes an estimated size as parameter. AByteBufferallows direct access to the byte array with minimal array copying- Specified by:
objectToBufferin classAbstractMarshaller- Parameters:
o- object to marshallestimatedSize- an estimate of how large the resulting byte array may be
-
objectFromByteBuffer
Description copied from interface:MarshallerUnmarshalls an object from a specific portion of a byte array.- Parameters:
buf- byte array containing the binary representation of an object. Must not be null.offset- point in buffer to start readinglength- number of bytes to consider- Returns:
- an object
-
isMarshallable
Description copied from interface:MarshallerA method that checks whether the given object is marshallable as per the rules of this marshaller.- Parameters:
o- object to verify whether it's marshallable or not- Returns:
- true if the object is marshallable, otherwise false
-
mediaType
- Returns:
- the
MediaTypeassociated with the content produced by the marshaller
-