Skip to content

Commit

Permalink
SquashFs lz4 decompression support
Browse files Browse the repository at this point in the history
  • Loading branch information
teplofizik committed Sep 2, 2022
1 parent 68d034d commit 943b4ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions NyaFs/Filesystem/SquashFs/Compression/Lz4.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;

namespace NyaFs.Filesystem.SquashFs.Compression
{
Expand Down Expand Up @@ -40,9 +41,12 @@ internal override byte[] Compress(byte[] data)
throw new NotImplementedException();
}

internal override byte[] Decompress(byte[] data)
internal override byte[] Decompress(byte[] Data)
{
throw new NotImplementedException();
var Res = new byte[8192];

FT.LZ4.LZ4Codec.Decode(Data, 0, Data.Length, Res, 0, Res.Length);
return Res;
}

[Flags]
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There is possible to add or update files in ramfs image.
Supported at now:
1. CPIO ASCII (RW)
2. EXT2 (R)
3. SquashFs [xz, gzip, lzma compressed] (R)
3. SquashFs [xz, gzip, lzma, lz4 compressed] (R)

## Supported compression types
Supported at now:
Expand Down Expand Up @@ -93,7 +93,7 @@ Load fs from ext2 image:
```
load <filename.ext2> ramfs ext2
```
Load fs from squashfs image (xz, gzip, lzma compressed):
Load fs from squashfs image (xz, gzip, lzma, lz4 compressed):
```
load <filename.ext2> ramfs squashfs
```
Expand Down

0 comments on commit 943b4ff

Please sign in to comment.