public class StringMarshaller extends AbstractMarshaller
marshallableTypeHints
Constructor and Description |
---|
StringMarshaller(Charset charset) |
Modifier and Type | Method and Description |
---|---|
boolean |
isMarshallable(Object o)
A method that checks whether the given object is marshallable as per the rules of this marshaller.
|
Object |
objectFromByteBuffer(byte[] buf,
int offset,
int length)
Unmarshalls an object from a specific portion of a byte array.
|
protected ByteBuffer |
objectToBuffer(Object o,
int estimatedSize)
This is a convenience method for converting an object into a
ByteBuffer which takes
an estimated size as parameter. |
getBufferSizePredictor, objectFromByteBuffer, objectFromInputStream, objectToBuffer, objectToByteBuffer, objectToByteBuffer
public StringMarshaller(Charset charset)
protected ByteBuffer objectToBuffer(Object o, int estimatedSize) throws IOException, InterruptedException
AbstractMarshaller
ByteBuffer
which takes
an estimated size as parameter. A ByteBuffer
allows direct access to the byte
array with minimal array copyingobjectToBuffer
in class AbstractMarshaller
o
- object to marshallestimatedSize
- an estimate of how large the resulting byte array may beIOException
InterruptedException
public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException
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 considerIOException
- if unmarshalling cannot complete due to some I/O errorClassNotFoundException
- if the class of the object trying to unmarshall is unknownpublic boolean isMarshallable(Object o) throws Exception
Marshaller
o
- object to verify whether it's marshallable or notException
- if while checking whether the object was serializable or not, an exception aroseCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.