Class WrappedMessageByteBufferMarshaller

java.lang.Object
org.wildfly.clustering.marshalling.protostream.WrappedMessageByteBufferMarshaller
All Implemented Interfaces:
ByteBufferMarshaller, Marshallability, Marshaller<Object,ByteBuffer>

public class WrappedMessageByteBufferMarshaller extends Object implements ByteBufferMarshaller
A ByteBufferMarshaller based on a ProtoStream WrappedMessage.
Author:
Paul Ferraro
  • Constructor Details

    • WrappedMessageByteBufferMarshaller

      public WrappedMessageByteBufferMarshaller(org.infinispan.protostream.ImmutableSerializationContext context)
  • Method Details

    • isMarshallable

      public boolean isMarshallable(Object object)
      Description copied from interface: Marshallability
      Indicates whether the specified object can be marshalled.
      Specified by:
      isMarshallable in interface Marshallability
      Parameters:
      object - an object to be marshalled
      Returns:
      true, if the specified object can be marshalled, false otherwise
    • readFrom

      public Object readFrom(InputStream input) throws IOException
      Description copied from interface: ByteBufferMarshaller
      Reads an object from the specified input stream.
      Specified by:
      readFrom in interface ByteBufferMarshaller
      Parameters:
      input - an input stream
      Returns:
      the unmarshalled object
      Throws:
      IOException - if the object could not be read
    • writeTo

      public void writeTo(OutputStream output, Object object) throws IOException
      Description copied from interface: ByteBufferMarshaller
      Writes the specified object to the specified output stream.
      Specified by:
      writeTo in interface ByteBufferMarshaller
      Parameters:
      output - an output stream
      object - an object to marshal
      Throws:
      IOException - if the object could not be written
    • size

      public OptionalInt size(Object object)
      Description copied from interface: ByteBufferMarshaller
      Returns the marshalled size of the specified object.
      Specified by:
      size in interface ByteBufferMarshaller
      Parameters:
      object - the object whose marshalled size is to be computed
      Returns:
      the marshalled size of the specified object.