/// <summary> /// Unserializes a BinaryStream into the Attributes of this Instance /// </summary> /// <param name="reader">The Stream that contains the FileData</param> protected override void Unserialize(System.IO.BinaryReader reader) { lines = new Hashtable(); if (reader.BaseStream.Length <= 0x40) { return; } byte[] fi = reader.ReadBytes(0x40); SimPe.Data.MetaData.FormatCode fo = (SimPe.Data.MetaData.FormatCode)reader.ReadUInt16(); if (fo != Data.MetaData.FormatCode.normal) { return; } ushort count = reader.ReadUInt16(); filename = fi; format = fo; lines = new Hashtable(); if ((limit != 0) && (count > limit)) { count = (ushort)limit; // limit number of StrItem entries loaded } for (int i = 0; i < count; i++) { StrToken.Unserialize(reader, lines); } }
/// <summary> /// Constructor /// </summary> public Str() : base() { filename = new byte[64]; format = SimPe.Data.MetaData.FormatCode.normal; lines = new Hashtable(); this.limit = 0; }