using System; using System.Collections.Generic; using System.Text; using System.IO; namespace DSDecmp { /// /// An exception that is thrown by the decompression functions when there /// is not enough data available in order to properly decompress the input. /// public class NotEnoughDataException : IOException { private long currentOutSize; private long totalOutSize; /// /// Gets the actual number of written bytes. /// public long WrittenLength { get { return this.currentOutSize; } } /// /// Gets the number of bytes that was supposed to be written. /// public long DesiredLength { get { return this.totalOutSize; } } /// /// Creates a new NotEnoughDataException. /// /// The actual number of written bytes. /// The desired number of written bytes. public NotEnoughDataException(long currentOutSize, long totalOutSize) : base("Not enough data availble; 0x" + currentOutSize.ToString("X") + " of " + (totalOutSize < 0 ? "???" : ("0x" + totalOutSize.ToString("X"))) + " bytes written.") { this.currentOutSize = currentOutSize; this.totalOutSize = totalOutSize; } } }