public override void PrepareForCompilation()
{
DirectoryEntry.Offset = 0;
if (ShortIndex)
DirectoryEntry.Length = this.locaTable.Length * 2;
else
DirectoryEntry.Length = this.locaTable.Length * 4;
this.bytes = new byte[DirectoryEntry.PaddedLength];
int length = this.locaTable.Length;
int byteIdx = 0;
if (ShortIndex)
{
for (int idx = 0; idx < length; idx++)
{
int value = this.locaTable[idx] / 2;
this.bytes[byteIdx++] = (byte)(value >> 8);
this.bytes[byteIdx++] = (byte)(value);
}
}
else
{
for (int idx = 0; idx < length; idx++)
{
int value = this.locaTable[idx];
this.bytes[byteIdx++] = (byte)(value >> 24);
this.bytes[byteIdx++] = (byte)(value >> 16);
this.bytes[byteIdx++] = (byte)(value >> 8);
this.bytes[byteIdx++] = (byte)value;
}
}
DirectoryEntry.CheckSum = CalcChecksum(this.bytes);
}
byte[] bytes;