Skip to content

+EA 23.186 Nyaightly - Plugin.BaseCore

August 22, 2025

1 file modified.

Important Changes

Possible breaking changes. Click the filename to view the chunk.

IO (1)

cs
public static void WriteLZ4(string _path, byte[] _bytes) 
public static void WriteLZ4(string _path, byte[] _bytes, Compression compression = Compression.None) 

IO

public static T LoadStreamJson<T>(MemoryStream stream, JsonSerializerSettings se

cs
		return JsonConvert.DeserializeObject<T>(value, setting ?? jsReadGeneral);
	}

	public static void WriteLZ4(string _path, byte[] _bytes) 
	public static void WriteLZ4(string _path, byte[] _bytes, Compression compression = Compression.None) 
	{
		byte[] bytes = ((compression == Compression.LZ4) ? LZ4Codec.Wrap(_bytes, 0, _bytes.Length) : _bytes); 
		for (int i = 0; i < 5; i++)
		{
			string path = _path + ((i == 0) ? "" : (".b" + i));
			try
			{
				File.WriteAllBytes(path, _bytes); 
				File.WriteAllBytes(path, bytes); 
				break;
			}
			catch (Exception message)

public static byte[] ReadLZ4(string _path, int size, Compression compression)

cs
			continue;
		}
		byte[] array = File.ReadAllBytes(text);
		if (array.Length == size) 
		{ 
			return array; 
		} 
		if (compression == Compression.LZ4)
		{
			try

public static byte[] ReadLZ4(string _path, int size, Compression compression)

cs
				Debug.Log(message);
			}
		}
		if (array.Length == size) 
		{ 
			return array; 
		} 
	}
	return null;
}

public static bool IsCompressed(string path)

cs

	public static void Compress(string path, string text)
	{
		File.WriteAllText(path, text); 
		Debug.Log("Compressing: " + path); 
		using FileStream innerStream = new FileStream(path, FileMode.Create); 
		using LZ4Stream stream = new LZ4Stream(innerStream, LZ4StreamMode.Compress); 
		using StreamWriter streamWriter = new StreamWriter(stream); 
		streamWriter.Write(text); 
	}

	public static string Decompress(string path)