protected override void Read(BinaryReader reader) { PTCH = new PTCHChunk(reader); MD5 = new MD5Chunk(reader); XFRM = new XFRMChunk(reader); switch (XFRM.Type) { case BSD0ChunkName: BSD0 = new BSD0Chunk(reader); BSDIFF40 = BSD0.Unpack(); break; case COPYChunkName: COPY = new COPYChunk(reader); break; } }
private void ReadFile() { Contract.Ensures(PTCH != null); Contract.Ensures(MD5 != null); Contract.Ensures(XFRM != null); var stream = File.Open(FileName, FileMode.Open, FileAccess.Read, FileShare.Read); using (var reader = new BinaryReader(stream)) { PTCH = new PTCHChunk(reader); MD5 = new MD5Chunk(reader); XFRM = new XFRMChunk(reader); switch (XFRM.Type) { case BSD0ChunkName: BSD0 = new BSD0Chunk(reader); BSDIFF40 = BSD0.Unpack(); break; case COPYChunkName: COPY = new COPYChunk(reader); break; } } Contract.Assume(PTCH != null); Contract.Assume(MD5 != null); Contract.Assume(XFRM != null); }