IMatchFinder.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* This file is part of SevenZipSharp.
  2. SevenZipSharp is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU Lesser General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. SevenZipSharp is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU Lesser General Public License for more details.
  10. You should have received a copy of the GNU Lesser General Public License
  11. along with SevenZipSharp. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. using System;
  14. using System.IO;
  15. namespace SevenZip.Sdk.Compression.LZ
  16. {
  17. internal interface IInWindowStream
  18. {
  19. void SetStream(Stream inStream);
  20. void Init();
  21. void ReleaseStream();
  22. Byte GetIndexByte(Int32 index);
  23. UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit);
  24. UInt32 GetNumAvailableBytes();
  25. }
  26. internal interface IMatchFinder : IInWindowStream
  27. {
  28. void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
  29. UInt32 matchMaxLen, UInt32 keepAddBufferAfter);
  30. UInt32 GetMatches(UInt32[] distances);
  31. void Skip(UInt32 num);
  32. }
  33. }