Example #1
0
 /// <exception cref="System.IO.IOException"/>
 public override void Close()
 {
     if (fp == null)
     {
         throw new IOException("Trying to use aborted output stream");
     }
     try
     {
         // close should have been called after all pending transactions
         // have been flushed & synced.
         // if already closed, just skip
         if (doubleBuf != null)
         {
             doubleBuf.Close();
             doubleBuf = null;
         }
         // remove any preallocated padding bytes from the transaction log.
         if (fc != null && fc.IsOpen())
         {
             fc.Truncate(fc.Position());
             fc.Close();
             fc = null;
         }
         fp.Close();
         fp = null;
     }
     finally
     {
         IOUtils.Cleanup(Log, fc, fp);
         doubleBuf = null;
         fc        = null;
         fp        = null;
     }
     fp = null;
 }