Class XBDefaultEditableDocument

  • All Implemented Interfaces:
    XBDocument, XBEditableDocument

    @ParametersAreNonnullByDefault
    public class XBDefaultEditableDocument
    extends java.lang.Object
    implements XBEditableDocument
    Basic plain implementation of XBEditableDocument interface.
    • Constructor Detail

      • XBDefaultEditableDocument

        public XBDefaultEditableDocument​(XBBlock rootBlock)
      • XBDefaultEditableDocument

        public XBDefaultEditableDocument​(XBBlock rootBlock,
                                         @Nullable
                                         org.exbin.auxiliary.paged_data.BinaryData tailData)
    • Method Detail

      • getRootBlock

        @Nonnull
        public java.util.Optional<XBBlock> getRootBlock()
        Description copied from interface: XBDocument
        Returns root block of the document.
        Specified by:
        getRootBlock in interface XBDocument
        Returns:
        root block if exits or null.
      • getTailData

        @Nonnull
        public java.util.Optional<java.io.InputStream> getTailData()
        Description copied from interface: XBDocument
        Returns tail data input stream.
        Specified by:
        getTailData in interface XBDocument
        Returns:
        InputStream of providing read access to data area
      • getTailDataSize

        public long getTailDataSize()
        Description copied from interface: XBDocument
        Returns size of the tail data if available.
        Specified by:
        getTailDataSize in interface XBDocument
        Returns:
        length of tail data in bytes or -1 if not available or is infinite
      • getDocumentSize

        public long getDocumentSize()
        Description copied from interface: XBDocument
        Returns size of the whole document if available.
        Specified by:
        getDocumentSize in interface XBDocument
        Returns:
        length of whole document in bytes or -1 if not available or is infinite
      • setRootBlock

        public void setRootBlock​(XBBlock block)
        Description copied from interface: XBEditableDocument
        Sets root block of the document.
        Specified by:
        setRootBlock in interface XBEditableDocument
        Parameters:
        block - the block to use as root block for this document
      • setTailData

        public void setTailData​(@Nullable
                                java.io.InputStream source)
                         throws java.io.IOException
        Description copied from interface: XBEditableDocument
        Sets tail data.
        Specified by:
        setTailData in interface XBEditableDocument
        Parameters:
        source - data stream
        Throws:
        java.io.IOException - exception on input/output error