Interface Marshallable<T>

    • Method Detail

      • readFrom

        T readFrom​(ProtoStreamReader reader)
            throws IOException
        Reads an object from the specified reader.
        Parameters:
        reader - a ProtoStream reader
        Returns:
        the read object
        Throws:
        IOException - if the object could not be read
      • writeTo

        void writeTo​(ProtoStreamWriter writer,
                     T value)
              throws IOException
        Writes the specified object to the specified writer.
        Parameters:
        writer - a ProtoStream writer
        value - the object to be written
        Throws:
        IOException - if the object could not be written
      • size

        default OptionalInt size​(ProtoStreamSizeOperation operation,
                                 T value)
        Computes the size of the specified object.
        Parameters:
        context - the marshalling operation
        value - the value whose size is to be calculated
        Returns:
        an optional buffer size, only present if the buffer size could be computed
      • getJavaClass

        Class<? extends T> getJavaClass()
        Returns the type of object handled by this marshallable instance.
        Returns:
        the type of object handled by this marshallable instance.