Example #1
0
 private void PrepareInflater()
 {
     if (inf == null)
     {
         inf = InflaterCache.Get();
     }
     else
     {
         inf.Reset();
     }
 }
Example #2
0
 /*
  * Releases the specified inflater to the list of available inflaters.
  */
 private void ReleaseInflater(Inflater inf)
 {
     if (false == inf.Ended())
     {
         inf.Reset();
         lock (InflaterCache)
         {
             InflaterCache.Add(inf);
         }
     }
 }
Example #3
0
 /// <summary>Release the current window cursor.</summary>
 /// <remarks>Release the current window cursor.</remarks>
 public override void Release()
 {
     window = null;
     try
     {
         InflaterCache.Release(inf);
     }
     finally
     {
         inf = null;
     }
 }
Example #4
0
 /// <exception cref="System.IO.IOException"></exception>
 public override void Close()
 {
     try
     {
         if (this.remaining <= 0)
         {
             UnpackedObject.CheckValidEndOfStream(this.@in, this.inf, id, new byte[64]);
         }
     }
     finally
     {
         InflaterCache.Release(this.inf);
         base.Close();
     }
 }
Example #5
0
        private static InputStream Inflate(InputStream @in, long size, ObjectId id)
        {
            Inflater inf = InflaterCache.Get();

            return(new _InflaterInputStream_307(size, id, @in, inf));
        }