Package org.exbin.xbup.core.block
Class XBDefaultDocument
- java.lang.Object
-
- org.exbin.xbup.core.block.XBDefaultDocument
-
- All Implemented Interfaces:
XBDocument
@ParametersAreNonnullByDefault public class XBDefaultDocument extends java.lang.Object implements XBDocument
Basic plain implementation of XBDocument interface.
-
-
Constructor Summary
Constructors Constructor Description XBDefaultDocument(XBBlock rootBlock)
XBDefaultDocument(XBBlock rootBlock, java.io.InputStream tailDataStream)
XBDefaultDocument(XBBlock rootBlock, org.exbin.auxiliary.paged_data.BinaryData tailData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getDocumentSize()
Returns size of the whole document if available.java.util.Optional<XBBlock>
getRootBlock()
Returns root block of the document.java.util.Optional<java.io.InputStream>
getTailData()
Returns tail data input stream.long
getTailDataSize()
Returns size of the tail data if available.
-
-
-
Constructor Detail
-
XBDefaultDocument
public XBDefaultDocument(XBBlock rootBlock)
-
XBDefaultDocument
public XBDefaultDocument(XBBlock rootBlock, @Nullable org.exbin.auxiliary.paged_data.BinaryData tailData)
-
XBDefaultDocument
public XBDefaultDocument(XBBlock rootBlock, java.io.InputStream tailDataStream) throws java.io.IOException
- Throws:
java.io.IOException
-
-
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 interfaceXBDocument
- 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 interfaceXBDocument
- 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 interfaceXBDocument
- 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 interfaceXBDocument
- Returns:
- length of whole document in bytes or -1 if not available or is infinite
-
-