Interface ByteBufferMarshaller
-
- All Superinterfaces:
Marshallability,Marshaller<Object,ByteBuffer>
public interface ByteBufferMarshaller extends Marshaller<Object,ByteBuffer>
Marshals an object to and from aByteBuffer.- Author:
- Paul Ferraro
-
-
Field Summary
Fields Modifier and Type Field Description static org.jboss.logging.LoggerLOGGER
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Objectread(ByteBuffer buffer)Reads a value from its marshalled form.ObjectreadFrom(InputStream input)Reads an object from the specified input stream.default OptionalIntsize(Object object)Returns the marshalled size of the specified object.default ByteBufferwrite(Object object)Writes a value to its serialized formvoidwriteTo(OutputStream output, Object object)Writes the specified object to the specified output stream.-
Methods inherited from interface org.wildfly.clustering.marshalling.spi.Marshallability
isMarshallable
-
-
-
-
Method Detail
-
readFrom
Object readFrom(InputStream input) throws IOException
Reads an object from the specified input stream.- Parameters:
input- an input stream- Returns:
- the unmarshalled object
- Throws:
IOException- if the object could not be read
-
writeTo
void writeTo(OutputStream output, Object object) throws IOException
Writes the specified object to the specified output stream.- Parameters:
output- an output streamobject- an object to marshal- Throws:
IOException- if the object could not be written
-
read
default Object read(ByteBuffer buffer) throws IOException
Description copied from interface:MarshallerReads a value from its marshalled form.- Specified by:
readin interfaceMarshaller<Object,ByteBuffer>- Parameters:
buffer- the marshalled form- Returns:
- an unmarshalled value/
- Throws:
IOException
-
write
default ByteBuffer write(Object object) throws IOException
Description copied from interface:MarshallerWrites a value to its serialized form- Specified by:
writein interfaceMarshaller<Object,ByteBuffer>- Returns:
- the serialized form of the value
- Throws:
IOException
-
size
default OptionalInt size(Object object)
Returns the marshalled size of the specified object.- Parameters:
buffer- a byte buffer- Returns:
- the marshalled size of the specified object.
-
-