Class PropertyBlock
java.lang.Object
org.docx4j.org.apache.poi.poifs.storage.PropertyBlock
- All Implemented Interfaces:
BlockWritable
public final class PropertyBlock
extends java.lang.Object
A block of Property instances
- Author:
- Marc Johnson (mjohnson at apache dot org)
-
Field Summary
Fields Modifier and Type Field Description protected POIFSBigBlockSize
bigBlockSize
Either 512 bytes (POIFSConstants.SMALLER_BIG_BLOCK_SIZE
) or 4096 bytes (POIFSConstants.LARGER_BIG_BLOCK_SIZE
) -
Method Summary
Modifier and Type Method Description static BlockWritable[]
createPropertyBlockArray(POIFSBigBlockSize bigBlockSize, java.util.List<Property> properties)
Create an array of PropertyBlocks from an array of Property instances, creating empty Property instances to make up any shortfallprotected 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.void
writeBlocks(java.io.OutputStream stream)
Write the storage to an OutputStream
-
Field Details
-
bigBlockSize
Either 512 bytes (POIFSConstants.SMALLER_BIG_BLOCK_SIZE
) or 4096 bytes (POIFSConstants.LARGER_BIG_BLOCK_SIZE
)
-
-
Method Details
-
createPropertyBlockArray
public static BlockWritable[] createPropertyBlockArray(POIFSBigBlockSize bigBlockSize, java.util.List<Property> properties)Create an array of PropertyBlocks from an array of Property instances, creating empty Property instances to make up any shortfall- Parameters:
properties
- the Property instances to be converted into PropertyBlocks, in a java List- Returns:
- the array of newly created PropertyBlock instances
-
doWriteData
protected void doWriteData(java.io.OutputStream stream, byte[] data) throws java.io.IOExceptionDefault implementation of write for extending classes that contain their data in a simple array of bytes.- Parameters:
stream
- the OutputStream to which the data should be written.data
- the byte array of to be written.- Throws:
java.io.IOException
- on problems writing to the specified stream.
-
writeBlocks
public void writeBlocks(java.io.OutputStream stream) throws java.io.IOExceptionWrite the storage to an OutputStream- Specified by:
writeBlocks
in interfaceBlockWritable
- Parameters:
stream
- the OutputStream to which the stored data should be written- Throws:
java.io.IOException
- on problems writing to the specified stream
-