/// <summary> /// Loads the specified binary tag structure and merges its tags with the current structure. The current structure is cleared in the process. /// </summary> /// <param name="stream">The stream that contains data about the binary tag structure.</param> public void LoadFrom(Stream stream) { BinaryTagStructure structure = new BinaryTagStructure(); structure.LoadStructure(stream); this.Clear(); this.Merge(structure, MergeMethod.Overwrite); }
/// <summary> /// Loads the binary tag structure from its file path. /// </summary> public void Load() { // Will only attempt to load the structure if the file exists. if (File.Exists(this.Path)) { BinaryTagStructure structure = new BinaryTagStructure(); structure.LoadStructure(new FileStream(this.Path, FileMode.Open, FileAccess.Read)); this.Merge(structure, MergeMethod.Overwrite); } }