/* This file is part of SevenZipSharp. SevenZipSharp is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SevenZipSharp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with SevenZipSharp. If not, see . */ using System; using System.IO; namespace SevenZip.Sdk { /// /// The exception that is thrown when an error in input stream occurs during decoding. /// [Serializable] internal class DataErrorException : ApplicationException { public DataErrorException() : base("Data Error") {} } /// /// The exception that is thrown when the value of an argument is outside the allowable range. /// [Serializable] internal class InvalidParamException : ApplicationException { public InvalidParamException() : base("Invalid Parameter") {} } /// /// Callback progress interface. /// public interface ICodeProgress { /// /// Callback progress. /// /// /// Processed input size. -1 if unknown. /// /// /// Processed output size. -1 if unknown. /// void SetProgress(Int64 inSize, Int64 outSize); } ; /// /// Stream coder interface /// public interface ICoder { /// /// Codes streams. /// /// /// input Stream. /// /// /// output Stream. /// /// /// input Size. -1 if unknown. /// /// /// output Size. -1 if unknown. /// /// /// callback progress reference. /// /// /// if input stream is not valid /// 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. /// public 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 = 0x490 } ; /// /// The ISetCoderProperties interface /// internal interface ISetCoderProperties { void SetCoderProperties(CoderPropId[] propIDs, object[] properties); } ; /// /// The IWriteCoderProperties interface /// internal interface IWriteCoderProperties { void WriteCoderProperties(Stream outStream); } /// /// The ISetDecoderPropertiesinterface /// internal interface ISetDecoderProperties { /// /// Sets decoder properties /// /// Array of byte properties void SetDecoderProperties(byte[] properties); } }