public override void Write(BinaryWriter bw) { base.Write(bw); FileFlags fFlags = 0; if (Size != null) { fFlags |= FileFlags.Size; } if (CRC != null) { fFlags |= FileFlags.CRC; } if (SHA1 != null) { fFlags |= FileFlags.SHA1; } if (MD5 != null) { fFlags |= FileFlags.MD5; } if (SHA1CHD != null) { fFlags |= FileFlags.SHA1CHD; } if (MD5CHD != null) { fFlags |= FileFlags.MD5CHD; } if (!String.IsNullOrEmpty(Merge)) { fFlags |= FileFlags.Merge; } if (!String.IsNullOrEmpty(Status)) { fFlags |= FileFlags.Status; } if (ZipFileIndex >= 0) { fFlags |= FileFlags.ZipFileIndex; } if (ZipFileHeaderPosition != null) { fFlags |= FileFlags.ZipFileHeader; } if (CHDVersion != null) { fFlags |= FileFlags.CHDVersion; } bw.Write((UInt16)fFlags); if (Size != null) { bw.Write((ulong)Size); } if (CRC != null) { ArrByte.Write(bw, CRC); } if (SHA1 != null) { ArrByte.Write(bw, SHA1); } if (MD5 != null) { ArrByte.Write(bw, MD5); } if (SHA1CHD != null) { ArrByte.Write(bw, SHA1CHD); } if (MD5CHD != null) { ArrByte.Write(bw, MD5CHD); } if (!String.IsNullOrEmpty(Merge)) { bw.Write(Merge); } if (!String.IsNullOrEmpty(Status)) { bw.Write(Status); } if (ZipFileIndex >= 0) { bw.Write(ZipFileIndex); } if (ZipFileHeaderPosition != null) { bw.Write((long)ZipFileHeaderPosition); } if (CHDVersion != null) { bw.Write((uint)CHDVersion); } bw.Write((uint)_fileStatus); }