dsdecmp/CSharp/DSDecmp/Exceptions/TooMuchInputException.cs
barubary d64137221a C#: A step into a new system, where game-specific formats can be defined as plugins, preventing users from having to download DSDecmp itself again and again. Such plugins must be stores in a 'Plugins' folder in the same location as the DSDecmp.exe.
To keep the base program mobile, all native NDS formats do not require plugins.

The 8-bit Huffman format cannot be used to compress at the moment; thanks to CUE a bug has been found where the offset-field of a node overflows, corrupting the compressed file.
2011-11-13 16:14:45 +00:00

33 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace DSDecmp
{
/// <summary>
/// An exception indication that the input has more data than required in order
/// to decompress it. This may indicate that more sub-files are present in the file.
/// </summary>
public class TooMuchInputException : Exception
{
/// <summary>
/// Gets the number of bytes read by the decompressed to decompress the stream.
/// </summary>
public long ReadBytes { get; private set; }
/// <summary>
/// Creates a new exception indicating that the input has more data than necessary for
/// decompressing th stream. It may indicate that other data is present after the compressed
/// stream.
/// </summary>
/// <param name="readBytes">The number of bytes read by the decompressor.</param>
/// <param name="totLength">The indicated length of the input stream.</param>
public TooMuchInputException(long readBytes, long totLength)
: base("The input contains more data than necessary. Only used 0x"
+ readBytes.ToString("X") + " of 0x" + totLength.ToString("X") + " bytes")
{
this.ReadBytes = readBytes;
}
}
}