|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.poi.poifs.storage.SmallDocumentBlock
public class SmallDocumentBlock
Storage for documents that are too small to use regular DocumentBlocks for their data
| Method Summary | |
|---|---|
static int |
calcSize(int size)
Calculate the storage size of a set of SmallDocumentBlocks |
static SmallDocumentBlock[] |
convert(BlockWritable[] store,
int size)
Factory for creating SmallDocumentBlocks from DocumentBlocks |
static SmallDocumentBlock[] |
convert(byte[] array,
int size)
convert a single long array into an array of SmallDocumentBlock instances |
static java.util.List |
extract(ListManagedBlock[] blocks)
create a list of SmallDocumentBlock's from raw data |
static int |
fill(java.util.List blocks)
fill out a List of SmallDocumentBlocks so that it fully occupies a set of big blocks |
byte[] |
getData()
Get the data from the block |
static void |
read(BlockWritable[] blocks,
byte[] buffer,
int offset)
read data from an array of SmallDocumentBlocks |
void |
writeBlocks(java.io.OutputStream stream)
Write the storage to an OutputStream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SmallDocumentBlock[] convert(byte[] array,
int size)
array - the byte array to be convertedsize - the intended size of the array (which may be smaller)
public static int fill(java.util.List blocks)
blocks - the List to be filled out
public static SmallDocumentBlock[] convert(BlockWritable[] store,
int size)
throws java.io.IOException,
java.lang.ArrayIndexOutOfBoundsException
store - the original DocumentBlockssize - the total document size
java.io.IOException - on errors reading from the DocumentBlocks
java.lang.ArrayIndexOutOfBoundsException - if, somehow, the store
contains less data than size indicates
public static java.util.List extract(ListManagedBlock[] blocks)
throws java.io.IOException
blocks - the raw data containing the SmallDocumentBlock
data
java.io.IOException
public static void read(BlockWritable[] blocks,
byte[] buffer,
int offset)
blocks - the blocks to read frombuffer - the buffer to write the data intooffset - the offset into the array of blocks to read frompublic static int calcSize(int size)
size - number of SmallDocumentBlocks
public void writeBlocks(java.io.OutputStream stream)
throws java.io.IOException
writeBlocks in interface BlockWritablestream - the OutputStream to which the stored data should
be written
java.io.IOException - on problems writing to the specified
stream
public byte[] getData()
throws java.io.IOException
getData in interface ListManagedBlockjava.io.IOException - if there is no data
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||