Interface ByteBufferMarshaller

All Superinterfaces:
Marshaller<Object, ByteBuffer>, Predicate<Object>, Predicate<Object>
All Known Implementing Classes:
AbstractByteBufferMarshaller, JavaByteBufferMarshaller, JBossByteBufferMarshaller, ProtoStreamByteBufferMarshaller, WrappedMessageByteBufferMarshaller

public interface ByteBufferMarshaller extends Marshaller<Object, ByteBuffer>
Marshals an object to and from a ByteBuffer.
Author:
Paul Ferraro
  • Method Details

    • 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 stream
      object - 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: Marshaller
      Reads a value from its marshalled form.
      Specified by:
      read in interface Marshaller<Object, ByteBuffer>
      Parameters:
      buffer - the marshalled form
      Returns:
      an unmarshalled value
      Throws:
      IOException - if the value could not be read
    • write

      default ByteBuffer write(Object object) throws IOException
      Description copied from interface: Marshaller
      Writes a value to its serialized form
      Specified by:
      write in interface Marshaller<Object, ByteBuffer>
      Parameters:
      object - a value to marshal.
      Returns:
      the serialized form of the value
      Throws:
      IOException - if the value could not be written
    • size

      default OptionalInt size(Object object)
      Returns the marshalled size of the specified object.
      Parameters:
      object - the object whose marshalled size is to be computed
      Returns:
      the marshalled size of the specified object.