/// <summary> /// Deserialize a PatchInfo /// </summary> /// <param name="reader">A reader aligned to a serialized PatchInfo</param> public PatchInfo(BinaryReader reader) { //reading a FV (metadata) now Metadata = FileValidation.ReadFrom(reader); //reading data now var dataSize = reader.ReadUInt32(); Debug.Assert((int)dataSize == dataSize); if (dataSize > 0) { Data = reader.ReadBytes((int)dataSize); } }
private Patch ReadPatches(BinaryReader reader) { var target = FileValidation.ReadFrom(reader); var patchCount = reader.ReadInt32(); var patches = new PatchInfo[patchCount]; for (int i = 0; i < patchCount; i++) { patches[i] = new PatchInfo(reader); } return(new Patch(target, patches)); }