org.apache.poi.poifs.storage
Class HeaderBlock

java.lang.Object
  extended by org.apache.poi.poifs.storage.HeaderBlock
All Implemented Interfaces:
HeaderBlockConstants

public final class HeaderBlock
extends java.lang.Object
implements HeaderBlockConstants

The block containing the archive header


Field Summary
 
Fields inherited from interface org.apache.poi.poifs.storage.HeaderBlockConstants
_bat_array_offset, _bat_count_offset, _max_bats_in_header, _property_start_offset, _sbat_block_count_offset, _sbat_start_offset, _signature, _signature_offset, _xbat_count_offset, _xbat_start_offset
 
Constructor Summary
HeaderBlock(java.nio.ByteBuffer buffer)
           
HeaderBlock(java.io.InputStream stream)
          create a new HeaderBlockReader from an InputStream
HeaderBlock(POIFSBigBlockSize bigBlockSize)
          Create a single instance initialized with default values
 
Method Summary
 int[] getBATArray()
          Returns the offsets to the first (up to) 109 BAT sectors.
 int getBATCount()
           
 POIFSBigBlockSize getBigBlockSize()
           
 int getPropertyStart()
          get start of Property Table
 int getSBATCount()
           
 int getSBATStart()
           
 int getXBATCount()
           
 int getXBATIndex()
           
 void setBATArray(int[] bat_array)
          Sets the offsets of the first (up to) 109 BAT sectors.
 void setBATCount(int count)
          Sets the number of BAT blocks that are used.
 void setPropertyStart(int startBlock)
          Set start of Property Table
 void setSBATBlockCount(int count)
          Set count of SBAT blocks
 void setSBATStart(int startBlock)
          Set start of small block allocation table
 void setXBATCount(int count)
          Sets the number of XBAT (DIFAT) blocks used
 void setXBATStart(int startBlock)
          Sets the first XBAT (DIFAT) block location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderBlock

public HeaderBlock(java.io.InputStream stream)
            throws java.io.IOException
create a new HeaderBlockReader from an InputStream

Parameters:
stream - the source InputStream
Throws:
java.io.IOException - on errors or bad data

HeaderBlock

public HeaderBlock(java.nio.ByteBuffer buffer)
            throws java.io.IOException
Throws:
java.io.IOException

HeaderBlock

public HeaderBlock(POIFSBigBlockSize bigBlockSize)
Create a single instance initialized with default values

Method Detail

getPropertyStart

public int getPropertyStart()
get start of Property Table

Returns:
the index of the first block of the Property Table

setPropertyStart

public void setPropertyStart(int startBlock)
Set start of Property Table

Parameters:
startBlock - the index of the first block of the Property Table

getSBATStart

public int getSBATStart()
Returns:
start of small block (MiniFAT) allocation table

getSBATCount

public int getSBATCount()

setSBATStart

public void setSBATStart(int startBlock)
Set start of small block allocation table

Parameters:
startBlock - the index of the first big block of the small block allocation table

setSBATBlockCount

public void setSBATBlockCount(int count)
Set count of SBAT blocks

Parameters:
count - the number of SBAT blocks

getBATCount

public int getBATCount()
Returns:
number of BAT blocks

setBATCount

public void setBATCount(int count)
Sets the number of BAT blocks that are used. This is the number used in both the BAT and XBAT.


getBATArray

public int[] getBATArray()
Returns the offsets to the first (up to) 109 BAT sectors. Any additional BAT sectors are held in the XBAT (DIFAT) sectors in a chain.

Returns:
BAT offset array

setBATArray

public void setBATArray(int[] bat_array)
Sets the offsets of the first (up to) 109 BAT sectors.


getXBATCount

public int getXBATCount()
Returns:
XBAT (DIFAT) count

setXBATCount

public void setXBATCount(int count)
Sets the number of XBAT (DIFAT) blocks used


getXBATIndex

public int getXBATIndex()
Returns:
XBAT (DIFAT) index

setXBATStart

public void setXBATStart(int startBlock)
Sets the first XBAT (DIFAT) block location


getBigBlockSize

public POIFSBigBlockSize getBigBlockSize()
Returns:
The Big Block size, normally 512 bytes, sometimes 4096 bytes


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.