/// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="NGit.Diff.SimilarityIndex.TableFullException"></exception>
        private SimilarityIndex Hash(DiffEntry.Side side, DiffEntry ent)
        {
            SimilarityIndex r = new SimilarityIndex();

            r.Hash(reader.Open(side, ent));
            r.Sort();
            return(r);
        }
		public virtual void TestIndexingLargeObject()
		{
			byte[] @in = Sharpen.Runtime.GetBytesForString((string.Empty + "A\n" + "B\n" + "B\n"
				 + "B\n"), "UTF-8");
			//
			//
			//
			//
			SimilarityIndex si = new SimilarityIndex();
			si.Hash(new ByteArrayInputStream(@in), @in.Length);
			NUnit.Framework.Assert.AreEqual(2, si.Size());
		}
        public virtual void TestIndexingLargeObject()
        {
            byte[] @in = Sharpen.Runtime.GetBytesForString((string.Empty + "A\n" + "B\n" + "B\n"
                                                            + "B\n"), "UTF-8");
            //
            //
            //
            //
            SimilarityIndex si = new SimilarityIndex();

            si.Hash(new ByteArrayInputStream(@in), @in.Length);
            NUnit.Framework.Assert.AreEqual(2, si.Size());
        }
 /// <exception cref="System.IO.IOException"></exception>
 private int CalculateModifyScore(ContentSource.Pair reader, DiffEntry d)
 {
     try
     {
         SimilarityIndex src = new SimilarityIndex();
         src.Hash(reader.Open(DiffEntry.Side.OLD, d));
         src.Sort();
         SimilarityIndex dst = new SimilarityIndex();
         dst.Hash(reader.Open(DiffEntry.Side.NEW, d));
         dst.Sort();
         return(src.Score(dst, 100));
     }
     catch (SimilarityIndex.TableFullException)
     {
         // If either table overflowed while being constructed, don't allow
         // the pair to be broken. Returning 1 higher than breakScore will
         // ensure its not similar, but not quite dissimilar enough to break.
         //
         overRenameLimit = true;
         return(breakScore + 1);
     }
 }
		/// <exception cref="System.IO.IOException"></exception>
		/// <exception cref="NGit.Diff.SimilarityIndex.TableFullException"></exception>
		private SimilarityIndex Hash(DiffEntry.Side side, DiffEntry ent)
		{
			SimilarityIndex r = new SimilarityIndex();
			r.Hash(reader.Open(side, ent));
			r.Sort();
			return r;
		}