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, wait
initialize, start, stop
public static final BytesOnlyMarshaller INSTANCE
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 byte[] objectToByteBuffer(Object obj)
Marshaller
objectToByteBuffer
in interface Marshaller
obj
- object to convert to a byte array. Must not be null.public 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 objectFromByteBuffer(byte[] buf, int offset, int length)
Marshaller
objectFromByteBuffer
in interface Marshaller
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 considerpublic ByteBuffer objectToBuffer(Object o)
Marshaller
ByteBuffer
, which allows direct access to the byte
array with minimal array copyingobjectToBuffer
in interface Marshaller
o
- object to marshallpublic boolean isMarshallable(Object o)
Marshaller
isMarshallable
in interface Marshaller
o
- object to verify whether it's marshallable or notpublic BufferSizePredictor getBufferSizePredictor(Object o)
Marshaller
getBufferSizePredictor
in interface Marshaller
o
- Object for which serialized predictor will be returnedBufferSizePredictor
public MediaType mediaType()
mediaType
in interface Marshaller
MediaType
associated with the content produced by the marshallerCopyright © 2021 JBoss by Red Hat. All rights reserved.