91Act / lz4-unity

Unity wrapper for lz4 compress frame

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lz4-unity

This is a C# wrapper for Unity to use lz4 compress frame.

Install

  1. Copy Assets/lz4-unity/lz4.cs to the Unity project Assets/lz4-unity.
  2. Copy all the files under build/Plugins to Unity project Assets/Plugins.

Build

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 variable ANDROID_NDK points to NDK root.
  • make_win.bat Build for windows. VS 2015, or above, is required.

How to use

// 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!"

About

Unity wrapper for lz4 compress frame


Languages

Language:CMake 93.5%Language:C# 2.6%Language:Shell 1.9%Language:C 1.8%Language:Batchfile 0.2%