This is a C# wrapper for Unity to use lz4 compress frame.
- Copy
Assets/lz4-unity/lz4.cs
to the Unity projectAssets/lz4-unity
. - Copy all the files under
build/Plugins
to Unity projectAssets/Plugins
.
cmake is required
Under build
folder there are:
make_osx.sh
Build for macOS. Xcode is required.make_ios.sh
Build for iOS. Xcode is required.make_android.sh
Build for android. NDK is required and there should be an environment variableANDROID_NDK
points to NDK root.make_win.bat
Build for windows. VS 2015, or above, is required.
// Compress
var originalData = Encoding.UTF8.GetBytes("Hello World! Hello World! Hello World!");
var compressedData = lz4.Compress(originalData);
// Decompress
var uncompressedData = lz4.Decompress(compressedData);
Debug.Log(Encoding.UTF8.GetString(uncompressedData)); // "Hello World! Hello World! Hello World!"