public static void Uncompress(LogicCompressibleString str) { if (str.IsCompressed()) { ZLibHelper.DecompressInMySQLFormat(str.RemoveCompressed(), out byte[] output); if (output != null) { str.Set(Encoding.UTF8.GetString(output), str.GetCompressed()); } } }
/// <summary> /// Uncompresses the <see cref="LogicCompressibleString" /> instance. /// </summary> public static void Uncompress(LogicCompressibleString str) { if (str.IsCompressed()) { int compressedLength = str.GetCompressedLength(); byte[] compressedData = str.RemoveCompressed(); int uncompressedLength = ZLibHelper.DecompressInMySQLFormat(compressedData, compressedLength, out byte[] uncompressedData); if (uncompressedLength > 0) { str.Set(LogicStringUtil.CreateString(uncompressedData, 0, uncompressedLength)); } } }