Recent

Author Topic: Snappy decompressor in pure Pascal  (Read 237 times)

Tomxe

  • New Member
  • *
  • Posts: 42
Snappy decompressor in pure Pascal
« on: March 22, 2025, 02:15:06 pm »
Pure pascal decoder for Snappy files/data:
https://github.com/Xelitan/Snappy-decompressor-in-Pure-Pascal


Usage example:
Code: Pascal  [Select][+][-]
  1. var F,P: TFileStream;
  2. begin
  3.   F := TFileStream.Create('test.Snappy', fmOpenRead);
  4.   P := TFileStream.Create('test.txt', fmCreate);
  5.  
  6.   SnappyDecodeStream(F, P);
  7.  
  8.   p.Free;
  9.   F.Free;
  10. end;

Also:
Code: Pascal  [Select][+][-]
  1. var InData, OutData: TBytes;
  2.     F: TFileStream;
  3.     Str: String;
  4. begin
  5.   F := TFileStream.Create('test.Snappy', fmOpenRead);
  6.   SetLength(InData, F.Size);
  7.   F.Read(InData[0], F.Size);
  8.   F.Free;
  9.  
  10.   OutData := SnappyDecode(InData);
  11.   SetLength(Str, Length(OutData));
  12.   Move(OutData[0], Str[1], Length(Str));
  13.  
  14.   Memo1.Lines.Add(Str);
  15. end;

ALLIGATOR

  • Full Member
  • ***
  • Posts: 148
Re: Snappy decompressor in pure Pascal
« Reply #1 on: March 22, 2025, 02:40:20 pm »
🆒

 

TinyPortal © 2005-2018