public class BytesOnlyMarshaller extends Object implements Marshaller
| Modifier and Type | Field and Description |
|---|---|
static BytesOnlyMarshaller |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
BufferSizePredictor |
getBufferSizePredictor(Object o)
Returns a marshalled payload size predictor for a particular type.
|
boolean |
isMarshallable(Object o)
A method that checks whether the given object is marshallable as per the rules of this marshaller.
|
MediaType |
mediaType() |
Object |
objectFromByteBuffer(byte[] buf)
Unmarshalls an object from a byte array.
|
Object |
objectFromByteBuffer(byte[] buf,
int offset,
int length)
Unmarshalls an object from a specific portion of a byte array.
|
ByteBuffer |
objectToBuffer(Object o)
A method that returns an instance of
ByteBuffer, which allows direct access to the byte
array with minimal array copying |
byte[] |
objectToByteBuffer(Object obj)
Marshalls an object to a byte array.
|
byte[] |
objectToByteBuffer(Object obj,
int estimatedSize)
Marshalls an object to a byte array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, start, stoppublic static final BytesOnlyMarshaller INSTANCE
public byte[] objectToByteBuffer(Object obj, int estimatedSize)
MarshallerobjectToByteBuffer in interface Marshallerobj - object to convert to a byte array. Must not be null.estimatedSize - an estimate of how large the resulting byte array may bepublic byte[] objectToByteBuffer(Object obj)
MarshallerobjectToByteBuffer in interface Marshallerobj - object to convert to a byte array. Must not be null.public Object objectFromByteBuffer(byte[] buf)
MarshallerobjectFromByteBuffer in interface Marshallerbuf - byte array containing the binary representation of an object. Must not be null.public Object objectFromByteBuffer(byte[] buf, int offset, int length)
MarshallerobjectFromByteBuffer in interface Marshallerbuf - byte array containing the binary representation of an object. Must not be null.offset - point in buffer to start readinglength - number of bytes to considerpublic ByteBuffer objectToBuffer(Object o)
MarshallerByteBuffer, which allows direct access to the byte
array with minimal array copyingobjectToBuffer in interface Marshallero - object to marshallpublic boolean isMarshallable(Object o)
MarshallerisMarshallable in interface Marshallero - object to verify whether it's marshallable or notpublic BufferSizePredictor getBufferSizePredictor(Object o)
MarshallergetBufferSizePredictor in interface Marshallero - Object for which serialized predictor will be returnedBufferSizePredictorpublic MediaType mediaType()
mediaType in interface MarshallerMediaType associated with the content produced by the marshallerCopyright © 2022 JBoss by Red Hat. All rights reserved.