Package loci.poi.hpsf

Class MutablePropertySet

  • Direct Known Subclasses:
    SpecialPropertySet

    public class MutablePropertySet
    extends PropertySet

    Adds writing support to the PropertySet class.

    Please be aware that this class' functionality will be merged into the PropertySet class at a later time, so the API will change.

    Since:
    2003-02-19
    Version:
    $Id: MutablePropertySet.java 489730 2006-12-22 19:18:16Z bayard $
    Author:
    Rainer Klute <klute@rainer-klute.de>
    • Constructor Detail

      • MutablePropertySet

        public MutablePropertySet()

        Constructs a MutablePropertySet instance. Its primary task is to initialize the immutable field with their proper values. It also sets fields that might change to reasonable defaults.

      • MutablePropertySet

        public MutablePropertySet​(PropertySet ps)

        Constructs a MutablePropertySet by doing a deep copy of an existing PropertySet. All nested elements, i.e. Sections and Property instances, will be their mutable counterparts in the new MutablePropertySet.

        Parameters:
        ps - The property set to copy
    • Method Detail

      • setByteOrder

        public void setByteOrder​(int byteOrder)

        Sets the "byteOrder" property.

        Parameters:
        byteOrder - the byteOrder value to set
      • setFormat

        public void setFormat​(int format)

        Sets the "format" property.

        Parameters:
        format - the format value to set
      • setOSVersion

        public void setOSVersion​(int osVersion)

        Sets the "osVersion" property.

        Parameters:
        osVersion - the osVersion value to set
      • setClassID

        public void setClassID​(ClassID classID)

        Sets the property set stream's low-level "class ID" field.

        Parameters:
        classID - The property set stream's low-level "class ID" field.
        See Also:
        PropertySet.getClassID()
      • clearSections

        public void clearSections()

        Removes all sections from this property set.

      • addSection

        public void addSection​(Section section)

        Adds a section to this property set.

        Parameters:
        section - The Section to add. It will be appended after any sections that are already present in the property set and thus become the last section.
      • toInputStream

        public loci.common.RandomAccessInputStream toInputStream()
                                                          throws IOException,
                                                                 WritingNotSupportedException

        Returns the contents of this property set stream as an input stream. The latter can be used for example to write the property set into a POIFS document. The input stream represents a snapshot of the property set. If the latter is modified while the input stream is still being read, the modifications will not be reflected in the input stream but in the MutablePropertySet only.

        Returns:
        the contents of this property set stream
        Throws:
        WritingNotSupportedException - if HPSF does not yet support writing of a property's variant type.
        IOException - if an I/O exception occurs.