public ReadInt32 ( EndianType endianType ) : |
||
endianType | EndianType | |
return |
public Int32 ReadInt32(EndianType endianType)
{
if ((BitConverter.IsLittleEndian && endianType != EndianType.Little) || (!BitConverter.IsLittleEndian && endianType != EndianType.Big))
{
byte[] b = base.ReadBytes(4);
Array.Reverse(b);
return BitConverter.ToInt32(b, 0);
}
else
return base.ReadInt32();
}
public override void Construct(BinaryEndianReader br, QbItemType type) { //System.Diagnostics.Debug.WriteLine(string.Format("{0} - 0x{1}", type.ToString(), (base.StreamPos(br) - 4).ToString("X").PadLeft(8, '0'))); base.Construct(br, type); this.Values = new int[base.ItemCount]; for (int i = 0; i < base.ItemCount; i++) { _values[i] = br.ReadInt32(base.Root.PakFormat.EndianType); } base.ConstructEnd(br); }