@exception IOException error in reading the header from file
*/
private void readHeaderFromArray(byte[] a)
throws StandardException, IOException
{
ArrayInputStream inStream = new ArrayInputStream(a);
inStream.setLimit(0, CONTAINER_INFO_SIZE);
int fid = inStream.readInt();
if (fid != formatIdInteger)
{
throw StandardException.newException(
SQLState.DATA_UNKNOWN_CONTAINER_FORMAT, getIdentity(),
new Long(fid));
}
int status = inStream.readInt();
pageSize = inStream.readInt();
spareSpace = inStream.readInt();
minimumRecordSize = inStream.readInt();
initialPages = inStream.readShort();
PreAllocSize = inStream.readShort();
firstAllocPageNumber = inStream.readLong();
firstAllocPageOffset = inStream.readLong();
containerVersion = inStream.readLong();
estimatedRowCount = inStream.readLong();
lastLogInstant = null;
if (PreAllocSize == 0) // pre 2.0, we don't store this.
PreAllocSize = DEFAULT_PRE_ALLOC_SIZE;
long spare2 = inStream.readLong(); // read spare long
long spare3 = inStream.readLong(); // read spare long
// upgrade - if this is a container that was created before
// initialPages was stored, it will have a zero value. Set it to the
// default of 1.
if (initialPages == 0)
initialPages = 1;
// container read in from disk, reset preAllocation values
PreAllocThreshold = PRE_ALLOC_THRESHOLD;
// validate checksum
long onDiskChecksum = inStream.readLong();
checksum.reset();
checksum.update(a, 0, CONTAINER_INFO_SIZE - CHECKSUM_SIZE);
if (onDiskChecksum != checksum.getValue())
{