public void Read(byte[] data)
{
headerName = Encoding.ASCII.GetString (data, 0, 4);
// this is allegedly the length of the preset name
// but that doesn't seem to be the case. It contains values
// anywhere between 8 and 14 that I've seen, and the preset name
// is always 510 bytes.
unknownOne = BitConverter.ToUInt16 (data, 4);
PresetName = encoding.GetString (data, 6, PresetNameLength).Trim ((char) 0);
PreAmp = BitConverter.ToInt32 (data, 6 + PresetNameLength);
largeBandCount = BitConverter.ToInt32 (data, 10 + PresetNameLength);
largeBandData = new byte[4 * largeBandCount];
Array.Copy (data, 14 + PresetNameLength, largeBandData, 0, 4 * largeBandCount);
int offset = 14 + PresetNameLength + (4 * largeBandCount);
BandCount = BitConverter.ToInt32 (data, offset);
BandValues = new int[BandCount];
offset += 4;
for (int i = 0; i < BandCount; i++) {
BandValues[i] = BitConverter.ToInt32 (data, offset);
offset += 4;
}
}