Class XBTTreeDocument

  • All Implemented Interfaces:
    java.io.Serializable, org.exbin.xbup.core.block.XBTDocument, org.exbin.xbup.core.block.XBTEditableDocument, org.exbin.xbup.core.ubnumber.UBStreamable

    @ParametersAreNonnullByDefault
    public class XBTTreeDocument
    extends XBTTree
    implements org.exbin.xbup.core.block.XBTEditableDocument
    Basic object model parser XBUP level 1 document representation.
    See Also:
    Serialized Form
    • Constructor Detail

      • XBTTreeDocument

        public XBTTreeDocument()
      • XBTTreeDocument

        public XBTTreeDocument​(@Nullable
                               XBTTreeNode rootNode)
      • XBTTreeDocument

        public XBTTreeDocument​(@Nullable
                               org.exbin.xbup.core.catalog.XBCatalog catalog)
    • Method Detail

      • toStreamUB

        public int toStreamUB​(java.io.OutputStream stream)
                       throws java.io.IOException
        Specified by:
        toStreamUB in interface org.exbin.xbup.core.ubnumber.UBStreamable
        Overrides:
        toStreamUB in class XBTTree
        Throws:
        java.io.IOException
      • fromStreamUB

        public int fromStreamUB​(java.io.InputStream stream)
                         throws java.io.IOException,
                                org.exbin.xbup.core.parser.XBProcessingException
        Specified by:
        fromStreamUB in interface org.exbin.xbup.core.ubnumber.UBStreamable
        Overrides:
        fromStreamUB in class XBTTree
        Throws:
        java.io.IOException
        org.exbin.xbup.core.parser.XBProcessingException
      • getSizeUB

        public int getSizeUB()
        Specified by:
        getSizeUB in interface org.exbin.xbup.core.ubnumber.UBStreamable
        Overrides:
        getSizeUB in class XBTTree
      • getTailData

        @Nonnull
        public java.util.Optional<java.io.InputStream> getTailData()
        Specified by:
        getTailData in interface org.exbin.xbup.core.block.XBTDocument
      • getTailDataArray

        @Nullable
        public org.exbin.auxiliary.paged_data.BinaryData getTailDataArray()
      • setTailData

        public void setTailData​(@Nullable
                                java.io.InputStream source)
                         throws java.io.IOException
        Specified by:
        setTailData in interface org.exbin.xbup.core.block.XBTEditableDocument
        Throws:
        java.io.IOException
      • getTailDataSize

        public long getTailDataSize()
        Specified by:
        getTailDataSize in interface org.exbin.xbup.core.block.XBTDocument
      • clear

        public void clear()
        Specified by:
        clear in interface org.exbin.xbup.core.block.XBTEditableDocument
        Overrides:
        clear in class XBTTree
      • getRootBlock

        @Nonnull
        public java.util.Optional<org.exbin.xbup.core.block.XBTBlock> getRootBlock()
        Specified by:
        getRootBlock in interface org.exbin.xbup.core.block.XBTDocument
        Overrides:
        getRootBlock in class XBTTree
      • setRootBlock

        public void setRootBlock​(@Nullable
                                 org.exbin.xbup.core.block.XBTBlock block)
        Specified by:
        setRootBlock in interface org.exbin.xbup.core.block.XBTEditableDocument
      • wasModified

        public boolean wasModified()
      • setModified

        public void setModified​(boolean modified)
      • getFileName

        @Nullable
        public java.lang.String getFileName()
      • setFileName

        public void setFileName​(@Nullable
                                java.lang.String fileName)
      • fromFileUB

        public int fromFileUB()
                       throws java.io.IOException,
                              org.exbin.xbup.core.parser.XBProcessingException
        Throws:
        java.io.IOException
        org.exbin.xbup.core.parser.XBProcessingException
      • toFileUB

        public int toFileUB()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • findBlockByIndex

        @Nonnull
        public java.util.Optional<org.exbin.xbup.core.block.XBTBlock> findBlockByIndex​(long index)
        Specified by:
        findBlockByIndex in interface org.exbin.xbup.core.block.XBTEditableDocument
      • createNewBlock

        @Nonnull
        public org.exbin.xbup.core.block.XBTBlock createNewBlock​(@Nullable
                                                                 org.exbin.xbup.core.block.XBTBlock parent)
        Specified by:
        createNewBlock in interface org.exbin.xbup.core.block.XBTEditableDocument
      • getDocumentSize

        public long getDocumentSize()
        Specified by:
        getDocumentSize in interface org.exbin.xbup.core.block.XBTDocument