int infoShort = LittleEndian.getShort(std, 2);
_styleTypeCode = (infoShort & 0xf);
_baseStyleIndex = (infoShort & 0xfff0) >> 4;
infoShort = LittleEndian.getShort(std, 4);
_numUPX = infoShort & 0xf;
//first byte(s) of variable length section of std is the length of the
//style name and aliases string
int nameLength = 0;
int multiplier = 1;
if(word9)
{
nameLength = LittleEndian.getShort(std, baseLength);
multiplier = 2;
}
else
{
nameLength = std[baseLength];
}
//2 bytes for length, length then null terminator.
int grupxStart = multiplier + ((nameLength + 1) * multiplier) + baseLength;
int offset = 0;
for(int x = 0; x < _numUPX; x++)
{
int upxSize = LittleEndian.getShort(std, grupxStart + offset);
if(_styleTypeCode == PARAGRAPH_STYLE)
{
if(x == 0)
{
_papx = new byte[upxSize];
System.arraycopy(std, grupxStart + offset + 2, _papx, 0, upxSize);
}
else if(x == 1)
{
_chpx = new byte[upxSize];
System.arraycopy(std, grupxStart + offset + 2, _chpx, 0, upxSize);
}
}
else if(_styleTypeCode == CHARACTER_STYLE && x == 0)
{
_chpx = new byte[upxSize];
System.arraycopy(std, grupxStart + offset + 2, _chpx, 0, upxSize);
}
if(upxSize % 2 == 1)
{
++upxSize;
}
offset += 2 + upxSize;
}