using System;
using System.IO;
namespace SharpCompress.Compressors.LZMA
{
///
/// The exception that is thrown when an error in input stream occurs during decoding.
///
internal class DataErrorException : Exception
{
public DataErrorException()
: base("Data Error")
{
}
}
///
/// The exception that is thrown when the value of an argument is outside the allowable range.
///
internal class InvalidParamException : Exception
{
public InvalidParamException()
: base("Invalid Parameter")
{
}
}
internal interface ICodeProgress
{
///
/// Callback progress.
///
///
/// input size. -1 if unknown.
///
///
/// output size. -1 if unknown.
///
void SetProgress(Int64 inSize, Int64 outSize);
}
internal interface ICoder
{
///
/// Codes streams.
///
///
/// input Stream.
///
///
/// output Stream.
///
///
/// input Size. -1 if unknown.
///
///
/// output Size. -1 if unknown.
///
///
/// callback progress reference.
///
void Code(Stream inStream, Stream outStream,
Int64 inSize, Int64 outSize, ICodeProgress progress);
}
/*
public interface ICoder2
{
void Code(ISequentialInStream []inStreams,
const UInt64 []inSizes,
ISequentialOutStream []outStreams,
UInt64 []outSizes,
ICodeProgress progress);
};
*/
///
/// Provides the fields that represent properties idenitifiers for compressing.
///
internal enum CoderPropId
{
///
/// Specifies default property.
///
DefaultProp = 0,
///
/// Specifies size of dictionary.
///
DictionarySize,
///
/// Specifies size of memory for PPM*.
///
UsedMemorySize,
///
/// Specifies order for PPM methods.
///
Order,
///
/// Specifies Block Size.
///
BlockSize,
///
/// Specifies number of postion state bits for LZMA (0 - x - 4).
///
PosStateBits,
///
/// Specifies number of literal context bits for LZMA (0 - x - 8).
///
LitContextBits,
///
/// Specifies number of literal position bits for LZMA (0 - x - 4).
///
LitPosBits,
///
/// Specifies number of fast bytes for LZ*.
///
NumFastBytes,
///
/// Specifies match finder. LZMA: "BT2", "BT4" or "BT4B".
///
MatchFinder,
///
/// Specifies the number of match finder cyckes.
///
MatchFinderCycles,
///
/// Specifies number of passes.
///
NumPasses,
///
/// Specifies number of algorithm.
///
Algorithm,
///
/// Specifies the number of threads.
///
NumThreads,
///
/// Specifies mode with end marker.
///
EndMarker
}
internal interface ISetCoderProperties
{
void SetCoderProperties(CoderPropId[] propIDs, object[] properties);
}
internal interface IWriteCoderProperties
{
void WriteCoderProperties(Stream outStream);
}
internal interface ISetDecoderProperties
{
void SetDecoderProperties(byte[] properties);
}
}