public class POIFSDocument extends Object implements BATManaged, BlockWritable, POIFSViewable
Modifier and Type | Class and Description |
---|---|
private class |
POIFSDocument.BigBlockStore |
private class |
POIFSDocument.SmallBlockStore |
Modifier and Type | Field and Description |
---|---|
private POIFSDocument.BigBlockStore |
_big_store |
private DocumentProperty |
_property |
private int |
_size |
private POIFSDocument.SmallBlockStore |
_small_store |
private int |
bigBlockSize |
Constructor and Description |
---|
POIFSDocument(String name,
int size,
POIFSDocumentPath path,
POIFSWriterListener writer,
int blockSize)
Constructor
|
POIFSDocument(String name,
ListManagedBlock[] blocks,
int length,
int size)
Constructor from small blocks
|
POIFSDocument(String name,
RandomAccessInputStream stream,
int size)
Constructor
|
POIFSDocument(String name,
RawDataBlock[] blocks,
int length)
Constructor from large blocks
|
POIFSDocument(String name,
SmallDocumentBlock[] blocks,
int length)
Constructor from small blocks
|
Modifier and Type | Method and Description |
---|---|
int |
countBlocks()
Return the number of BigBlock's this instance uses
|
DocumentBlock[] |
getBigBlocks() |
int |
getBigBlockSize() |
(package private) DocumentProperty |
getDocumentProperty()
Get the DocumentProperty
|
String |
getShortDescription()
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
|
int |
getSize() |
BlockWritable[] |
getSmallBlocks()
return the array of SmallDocumentBlocks used
|
Object[] |
getViewableArray()
Get an array of objects, some of which may implement
POIFSViewable
|
Iterator |
getViewableIterator()
Get an Iterator of objects, some of which may implement
POIFSViewable
|
boolean |
preferArray()
Give viewers a hint as to whether to call getViewableArray or
getViewableIterator
|
(package private) void |
read(byte[] buffer,
int offset,
RandomAccessInputStream stream)
read data from the internal stores
|
void |
setStartBlock(int index)
Set the start block for this instance
|
void |
writeBlocks(OutputStream stream)
Write the storage to an OutputStream
|
private DocumentProperty _property
private int _size
private POIFSDocument.SmallBlockStore _small_store
private POIFSDocument.BigBlockStore _big_store
private int bigBlockSize
public POIFSDocument(String name, RawDataBlock[] blocks, int length) throws IOException
name
- the name of the POIFSDocumentblocks
- the big blocks making up the POIFSDocumentlength
- the actual length of the POIFSDocumentIOException
public POIFSDocument(String name, SmallDocumentBlock[] blocks, int length)
name
- the name of the POIFSDocumentblocks
- the small blocks making up the POIFSDocumentlength
- the actual length of the POIFSDocumentpublic POIFSDocument(String name, ListManagedBlock[] blocks, int length, int size) throws IOException
name
- the name of the POIFSDocumentblocks
- the small blocks making up the POIFSDocumentlength
- the actual length of the POIFSDocumentIOException
public POIFSDocument(String name, RandomAccessInputStream stream, int size) throws IOException
name
- the name of the POIFSDocumentstream
- the InputStream we read data fromIOException
- thrown on read errorspublic POIFSDocument(String name, int size, POIFSDocumentPath path, POIFSWriterListener writer, int blockSize) throws IOException
name
- the name of the POIFSDocumentsize
- the length of the POIFSDocumentpath
- the path of the POIFSDocumentwriter
- the writer who will eventually write the document
contentsIOException
- thrown on read errorspublic BlockWritable[] getSmallBlocks()
public DocumentBlock[] getBigBlocks()
public int getSize()
public int getBigBlockSize()
void read(byte[] buffer, int offset, RandomAccessInputStream stream)
buffer
- the buffer to write tooffset
- the offset into our storage to read fromDocumentProperty getDocumentProperty()
public void writeBlocks(OutputStream stream) throws IOException
writeBlocks
in interface BlockWritable
stream
- the OutputStream to which the stored data should
be writtenIOException
- on problems writing to the specified
streampublic int countBlocks()
countBlocks
in interface BATManaged
public void setStartBlock(int index)
setStartBlock
in interface BATManaged
index
- index into the array of blocks making up the
filesystempublic Object[] getViewableArray()
getViewableArray
in interface POIFSViewable
public Iterator getViewableIterator()
getViewableIterator
in interface POIFSViewable
public boolean preferArray()
preferArray
in interface POIFSViewable
public String getShortDescription()
getShortDescription
in interface POIFSViewable
Copyright © 2016 Open Microscopy Environment