void ParseFile() { int tableEntries = BitConverter.ToInt16(rawBytes, 12); int quoteEntries = BitConverter.ToInt16(rawBytes, 14); int quoteOffset = tableEntries * 64 + 36; int stringOffset = quoteEntries * 20 + quoteOffset; int type0Count = BitConverter.ToInt16(rawBytes, 16); int type1Count = BitConverter.ToInt16(rawBytes, 18); int type2Count = BitConverter.ToInt16(rawBytes, 20); int type0Offset = BitConverter.ToInt16(rawBytes, 24); int type1Offset = BitConverter.ToInt16(rawBytes, 28); int type2Offset = BitConverter.ToInt16(rawBytes, 32); bool I_04_Check = false; if (BitConverter.ToInt16(rawBytes, 4) == -2) { I_04_Check = true; } else { I_04_Check = false; } qbt_File = new QBT_File() { I_04 = I_04_Check, Type0 = ReadTableSection(type0Offset, type0Count, quoteOffset, stringOffset), Type1 = ReadTableSection(type1Offset, type1Count, quoteOffset, stringOffset), Type2 = ReadTableSection(type2Offset, type2Count, quoteOffset, stringOffset), }; }
public Deserializer(string location) { saveLocation = String.Format("{0}/{1}", Path.GetDirectoryName(location), Path.GetFileNameWithoutExtension(location)); YAXSerializer serializer = new YAXSerializer(typeof(QBT_File), YAXSerializationOptions.DontSerializeNullObjects); qbt_File = (QBT_File)serializer.DeserializeFromFile(location); Validation(); WriteBinaryFile(); }
public Deserializer(QBT_File _qbtFile, string location) { saveLocation = location; qbt_File = _qbtFile; WriteBinaryFile(); }