File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ namespace Totk.ZStdTool.Helpers;
55
66public class ZStdHelper
77{
8+ private static readonly Decompressor _defaultDecompressor = new ( ) ;
89 private static readonly Decompressor _commonDecompressor = new ( ) ;
910 private static readonly Decompressor _mapDecompressor = new ( ) ;
1011 private static readonly Decompressor _packDecompressor = new ( ) ;
12+ private static readonly Compressor _defaultCompressor = new ( 16 ) ;
1113 private static readonly Compressor _commonCompressor = new ( 16 ) ;
1214 private static readonly Compressor _mapCompressor = new ( 16 ) ;
1315 private static readonly Compressor _packCompressor = new ( 16 ) ;
@@ -32,6 +34,7 @@ public static Span<byte> Decompress(string file)
3234 return
3335 file . EndsWith ( ".bcett.byml.zs" ) ? _mapDecompressor . Unwrap ( src ) :
3436 file . EndsWith ( ".pack.zs" ) ? _packDecompressor . Unwrap ( src ) :
37+ file . EndsWith ( ".rsizetable.zs" ) ? _defaultDecompressor . Unwrap ( src ) :
3538 _commonDecompressor . Unwrap ( src ) ;
3639 }
3740 public static Span < byte > Compress ( string file )
@@ -40,6 +43,7 @@ public static Span<byte> Compress(string file)
4043 return
4144 file . EndsWith ( ".bcett.byml" ) ? _mapCompressor . Wrap ( src ) :
4245 file . EndsWith ( ".pack" ) ? _packCompressor . Wrap ( src ) :
46+ file . EndsWith ( ".rsizetable" ) ? _defaultCompressor . Wrap ( src ) :
4347 _commonCompressor . Wrap ( src ) ;
4448 }
4549
You can’t perform that action at this time.
0 commit comments