Class ProtoStreamMarshaller

  • All Implemented Interfaces:
    Marshaller

    public class ProtoStreamMarshaller
    extends AbstractMarshaller
    Provides the starting point for implementing a Marshaller that uses Protobuf encoding.
    Since:
    6.0
    Author:
    anistor@redhat.com
    • Constructor Detail

      • ProtoStreamMarshaller

        public ProtoStreamMarshaller()
      • ProtoStreamMarshaller

        public ProtoStreamMarshaller​(org.infinispan.protostream.SerializationContext serializationContext)
    • Method Detail

      • register

        public void register​(org.infinispan.protostream.SerializationContextInitializer initializer)
      • getSerializationContext

        public org.infinispan.protostream.SerializationContext getSerializationContext()
        Returns:
        the SerializationContext instance to use
      • objectFromByteBuffer

        public Object objectFromByteBuffer​(byte[] buf,
                                           int offset,
                                           int length)
                                    throws IOException,
                                           ClassNotFoundException
        Description copied from interface: Marshaller
        Unmarshalls an object from a specific portion of a byte array.
        Parameters:
        buf - byte array containing the binary representation of an object. Must not be null.
        offset - point in buffer to start reading
        length - number of bytes to consider
        Returns:
        an object
        Throws:
        IOException - if unmarshalling cannot complete due to some I/O error
        ClassNotFoundException - if the class of the object trying to unmarshall is unknown
      • isMarshallable

        public boolean isMarshallable​(Object o)
        Description copied from interface: Marshaller
        A method that checks whether the given object is marshallable as per the rules of this marshaller.
        Parameters:
        o - object to verify whether it's marshallable or not
        Returns:
        true if the object is marshallable, otherwise false
      • mediaType

        public org.infinispan.commons.dataconversion.MediaType mediaType()
        Returns:
        the MediaType associated with the content produced by the marshaller