LzmaEncoderProperties.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. namespace SharpCompress.Compressors.LZMA
  2. {
  3. public class LzmaEncoderProperties
  4. {
  5. internal CoderPropId[] _propIDs;
  6. internal object[] _properties;
  7. public LzmaEncoderProperties()
  8. : this(false)
  9. {
  10. }
  11. public LzmaEncoderProperties(bool eos)
  12. : this(eos, 1 << 20)
  13. {
  14. }
  15. public LzmaEncoderProperties(bool eos, int dictionary)
  16. : this(eos, dictionary, 32)
  17. {
  18. }
  19. public LzmaEncoderProperties(bool eos, int dictionary, int numFastBytes)
  20. {
  21. int posStateBits = 2;
  22. int litContextBits = 3;
  23. int litPosBits = 0;
  24. int algorithm = 2;
  25. string mf = "bt4";
  26. _propIDs = new[]
  27. {
  28. CoderPropId.DictionarySize,
  29. CoderPropId.PosStateBits,
  30. CoderPropId.LitContextBits,
  31. CoderPropId.LitPosBits,
  32. CoderPropId.Algorithm,
  33. CoderPropId.NumFastBytes,
  34. CoderPropId.MatchFinder,
  35. CoderPropId.EndMarker
  36. };
  37. _properties = new object[]
  38. {
  39. dictionary,
  40. posStateBits,
  41. litContextBits,
  42. litPosBits,
  43. algorithm,
  44. numFastBytes,
  45. mf,
  46. eos
  47. };
  48. }
  49. }
  50. }