public final class DocumentBlock
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected POIFSBigBlockSize |
bigBlockSize
Either 512 bytes (
POIFSConstants.SMALLER_BIG_BLOCK_SIZE )
or 4096 bytes (POIFSConstants.LARGER_BIG_BLOCK_SIZE ) |
Constructor and Description |
---|
DocumentBlock(java.io.InputStream stream,
POIFSBigBlockSize bigBlockSize)
Create a single instance initialized with data.
|
DocumentBlock(RawDataBlock block)
create a document block from a raw data block
|
Modifier and Type | Method and Description |
---|---|
static DocumentBlock[] |
convert(POIFSBigBlockSize bigBlockSize,
byte[] array,
int size)
convert a single long array into an array of DocumentBlock
instances
|
protected void |
doWriteData(java.io.OutputStream stream,
byte[] data)
Default implementation of write for extending classes that
contain their data in a simple array of bytes.
|
static DataInputBlock |
getDataInputBlock(DocumentBlock[] blocks,
int offset) |
static byte |
getFillByte() |
boolean |
partiallyRead()
Was this a partially read block?
|
int |
size()
Get the number of bytes read for this block
|
void |
writeBlocks(java.io.OutputStream stream)
Write the storage to an OutputStream
|
protected POIFSBigBlockSize bigBlockSize
POIFSConstants.SMALLER_BIG_BLOCK_SIZE
)
or 4096 bytes (POIFSConstants.LARGER_BIG_BLOCK_SIZE
)public DocumentBlock(RawDataBlock block) throws java.io.IOException
block
- the raw data blockjava.io.IOException
public DocumentBlock(java.io.InputStream stream, POIFSBigBlockSize bigBlockSize) throws java.io.IOException
stream
- the InputStream delivering the data.java.io.IOException
public int size()
public boolean partiallyRead()
public static byte getFillByte()
public static DocumentBlock[] convert(POIFSBigBlockSize bigBlockSize, byte[] array, int size)
array
- the byte array to be convertedsize
- the intended size of the array (which may be smaller)public static DataInputBlock getDataInputBlock(DocumentBlock[] blocks, int offset)
protected void doWriteData(java.io.OutputStream stream, byte[] data) throws java.io.IOException
stream
- the OutputStream to which the data should be
written.data
- the byte array of to be written.java.io.IOException
- on problems writing to the specified
stream.public void writeBlocks(java.io.OutputStream stream) throws java.io.IOException
writeBlocks
in interface BlockWritable
stream
- the OutputStream to which the stored data should
be writtenjava.io.IOException
- on problems writing to the specified
streamCopyright © 2005-2010 Potix Corporation. All Rights Reserved.