Interface FieldSetMarshaller<T,​B>

    • Method Detail

      • getBuilder

        B getBuilder()
        Returns a builder for use with readField(ProtoStreamReader, int, Object). May return a shared instance, if the builder type is immutable, or a new instance, if the builder is mutable.
        Returns:
        a builder.
      • getFields

        int getFields()
        Returns the number of fields written by this marshaller.
        Returns:
        a positive number
      • readField

        B readField​(ProtoStreamReader reader,
                    int index,
                    B builder)
             throws IOException
        Reads a single field from the specified reader at the specified index.
        Parameters:
        reader - a ProtoStream reader
        index - the field index
        builder - the builder to be populated with the read field
        Returns:
        the builder containing the read field
        Throws:
        IOException - if the field could not be read
      • writeFields

        void writeFields​(ProtoStreamWriter writer,
                         int startIndex,
                         T value)
                  throws IOException
        Writes the set of fields from the specified object to the specified writer beginning at the specified index.
        Parameters:
        writer - a ProtoStream writer
        startIndex - the start index for the embedded fields
        value - the value to be written
        Throws:
        IOException - if the value could not be written