05 2012 档案

摘要:网上看到别人在写这样一个方法,就尝试能够在Unity中使用该方法。记住要使用的程序包:using System.IO;using System.Runtime.Serialization.Formatters.Binary;public object DeepCopy(object src){MemoryStream ms = new MemoryStream();BinaryFormatter bf = new BinaryFormatter();bf.Serialize(ms, src);ms.Seek(0, SeekOrigin.Begin);object dst = bf.Deseri 阅读全文
posted @ 2012-05-08 09:53 peiandsky 阅读(1865) 评论(0) 推荐(0) 编辑
摘要:基于BZip2的压缩方式(ICSharpCode.SharpZipLib)压缩和解压代码举例:MemoryStream ms = new MemoryStream(); BZip2OutputStream zlib = new BZip2OutputStream(ms); byte[] src = Encoding.UTF8.GetBytes("#¥%……%……&@"); zlib.Write(src, 0, src.Length); zlib.Close(); byte[] press = ms.ToArray(); Debug.Log(Convert.ToBas 阅读全文
posted @ 2012-05-08 09:31 peiandsky 阅读(1675) 评论(0) 推荐(0) 编辑