/// <summary>
        /// The create output.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <returns>
        /// The <see cref="IndexOutput"/>.
        /// </returns>
        public override IndexOutput CreateOutput(string name)
        {
            var record = this.GetRecord(name);

            if (record.Exists)
            {
                try
                {
                    this.DeleteFile(name);
                }
                catch (Exception)
                {
                    throw new IOException("Cannot overwrite: " + record);
                }
            }

            IBufferedPageWriter writer = this.GetReaderWriter(record, false);

            return(new EncryptedIndexOutput(writer));
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EncryptedIndexOutput"/> class.
 /// </summary>
 /// <param name="writer">
 /// The writer.
 /// </param>
 public EncryptedIndexOutput(IBufferedPageWriter writer)
 {
     this.writer = writer;
 }