org.apache.poi.poifs.filesystem
Class POIFSDocument
- java.lang.Object
-
- org.apache.poi.poifs.filesystem.POIFSDocument
-
- All Implemented Interfaces:
- POIFSViewable, BATManaged, BlockWritable
public final class POIFSDocument extends java.lang.Object implements BATManaged, BlockWritable, POIFSViewable
This class manages a document in the POIFS filesystem.
-
-
Constructor Summary
Constructors Constructor and Description POIFSDocument(java.lang.String name, java.io.InputStream stream)POIFSDocument(java.lang.String name, int size, POIFSBigBlockSize bigBlockSize, POIFSDocumentPath path, POIFSWriterListener writer)ConstructorPOIFSDocument(java.lang.String name, int size, POIFSDocumentPath path, POIFSWriterListener writer)POIFSDocument(java.lang.String name, ListManagedBlock[] blocks, int length)POIFSDocument(java.lang.String name, POIFSBigBlockSize bigBlockSize, java.io.InputStream stream)ConstructorPOIFSDocument(java.lang.String name, POIFSBigBlockSize bigBlockSize, ListManagedBlock[] blocks, int length)Constructor from small blocksPOIFSDocument(java.lang.String name, RawDataBlock[] blocks, int length)Constructor from large blocksPOIFSDocument(java.lang.String name, SmallDocumentBlock[] blocks, int length)Constructor from small blocks
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcountBlocks()Return the number of BigBlock's this instance usesjava.lang.StringgetShortDescription()Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.intgetSize()BlockWritable[]getSmallBlocks()java.lang.Object[]getViewableArray()Get an array of objects, some of which may implement POIFSViewablejava.util.Iterator<java.lang.Object>getViewableIterator()Get an Iterator of objects, some of which may implement POIFSViewablebooleanpreferArray()Give viewers a hint as to whether to call getViewableArray or getViewableIteratorvoidsetStartBlock(int index)Set the start block for this instancevoidwriteBlocks(java.io.OutputStream stream)Write the storage to an OutputStream
-
-
-
Constructor Detail
-
POIFSDocument
public POIFSDocument(java.lang.String name, RawDataBlock[] blocks, int length) throws java.io.IOExceptionConstructor from large blocks- Parameters:
name- the name of the POIFSDocumentblocks- the big blocks making up the POIFSDocumentlength- the actual length of the POIFSDocument- Throws:
java.io.IOException
-
POIFSDocument
public POIFSDocument(java.lang.String name, SmallDocumentBlock[] blocks, int length)Constructor from small blocks- Parameters:
name- the name of the POIFSDocumentblocks- the small blocks making up the POIFSDocumentlength- the actual length of the POIFSDocument
-
POIFSDocument
public POIFSDocument(java.lang.String name, POIFSBigBlockSize bigBlockSize, ListManagedBlock[] blocks, int length) throws java.io.IOExceptionConstructor from small blocks- Parameters:
name- the name of the POIFSDocumentblocks- the small blocks making up the POIFSDocumentlength- the actual length of the POIFSDocument- Throws:
java.io.IOException
-
POIFSDocument
public POIFSDocument(java.lang.String name, ListManagedBlock[] blocks, int length) throws java.io.IOException- Throws:
java.io.IOException
-
POIFSDocument
public POIFSDocument(java.lang.String name, POIFSBigBlockSize bigBlockSize, java.io.InputStream stream) throws java.io.IOExceptionConstructor- Parameters:
name- the name of the POIFSDocumentstream- the InputStream we read data from- Throws:
java.io.IOException
-
POIFSDocument
public POIFSDocument(java.lang.String name, java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
POIFSDocument
public POIFSDocument(java.lang.String name, int size, POIFSBigBlockSize bigBlockSize, POIFSDocumentPath path, POIFSWriterListener writer)Constructor- Parameters:
name- the name of the POIFSDocumentsize- the length of the POIFSDocumentpath- the path of the POIFSDocumentwriter- the writer who will eventually write the document contents
-
POIFSDocument
public POIFSDocument(java.lang.String name, int size, POIFSDocumentPath path, POIFSWriterListener writer)
-
-
Method Detail
-
getSmallBlocks
public BlockWritable[] getSmallBlocks()
- Returns:
- array of SmallDocumentBlocks; may be empty, cannot be null
-
getSize
public int getSize()
- Returns:
- size of the document
-
writeBlocks
public void writeBlocks(java.io.OutputStream stream) throws java.io.IOExceptionWrite the storage to an OutputStream- Specified by:
writeBlocksin interfaceBlockWritable- Parameters:
stream- the OutputStream to which the stored data should be written- Throws:
java.io.IOException- on problems writing to the specified stream
-
countBlocks
public int countBlocks()
Return the number of BigBlock's this instance uses- Specified by:
countBlocksin interfaceBATManaged- Returns:
- count of BigBlock instances
-
setStartBlock
public void setStartBlock(int index)
Set the start block for this instance- Specified by:
setStartBlockin interfaceBATManaged- Parameters:
index- index into the array of blocks making up the filesystem
-
getViewableArray
public java.lang.Object[] getViewableArray()
Get an array of objects, some of which may implement POIFSViewable- Specified by:
getViewableArrayin interfacePOIFSViewable- Returns:
- an array of Object; may not be null, but may be empty
-
getViewableIterator
public java.util.Iterator<java.lang.Object> getViewableIterator()
Get an Iterator of objects, some of which may implement POIFSViewable- Specified by:
getViewableIteratorin interfacePOIFSViewable- Returns:
- an Iterator; may not be null, but may have an empty back end store
-
preferArray
public boolean preferArray()
Give viewers a hint as to whether to call getViewableArray or getViewableIterator- Specified by:
preferArrayin interfacePOIFSViewable- Returns:
trueif a viewer should call getViewableArray,falseif a viewer should call getViewableIterator
-
getShortDescription
public java.lang.String getShortDescription()
Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.- Specified by:
getShortDescriptionin interfacePOIFSViewable- Returns:
- short description
-
-
DataMelt 3.0 © DataMelt by jWork.ORG