Sharpen.PrintWriter.Close C# (CSharp) Method

Close() public method

public Close ( ) : void
return void
        public override void Close()
        {
            writer.Close ();
        }

Usage Example

 public virtual void TestAddUnstagedChanges()
 {
     FilePath file = new FilePath(db.WorkTree, "a.txt");
     FileUtils.CreateNewFile(file);
     PrintWriter writer = new PrintWriter(file);
     writer.Write("content");
     writer.Close();
     Git git = new Git(db);
     git.Add().AddFilepattern("a.txt").Call();
     RevCommit commit = git.Commit().SetMessage("initial commit").Call();
     TreeWalk tw = TreeWalk.ForPath(db, "a.txt", commit.Tree);
     NUnit.Framework.Assert.AreEqual("6b584e8ece562ebffc15d38808cd6b98fc3d97ea", tw.GetObjectId
         (0).GetName());
     writer = new PrintWriter(file);
     writer.Write("content2");
     writer.Close();
     commit = git.Commit().SetMessage("second commit").Call();
     tw = TreeWalk.ForPath(db, "a.txt", commit.Tree);
     NUnit.Framework.Assert.AreEqual("6b584e8ece562ebffc15d38808cd6b98fc3d97ea", tw.GetObjectId
         (0).GetName());
     commit = git.Commit().SetAll(true).SetMessage("third commit").SetAll(true).Call();
     tw = TreeWalk.ForPath(db, "a.txt", commit.Tree);
     NUnit.Framework.Assert.AreEqual("db00fd65b218578127ea51f3dffac701f12f486a", tw.GetObjectId
         (0).GetName());
 }
All Usage Examples Of Sharpen.PrintWriter::Close