【发布时间】:2014-02-18 13:00:30
【问题描述】:
有人知道如何压缩 Ti.Utils.base64encode 吗? 例如我有这个代码:
uploadFile = Ti.Filesystem.getFile(pathFile, listing[_fileCtr].toString());
uploadFileName = listing[_fileCtr].toString();
encodedFile = Ti.Utils.base64encode(uploadFile.read()).toString();
//Send Image to .NET web service
这是我的网络服务中从钛解压缩图像的方法(如果我之前可以压缩我的图像):
static byte[] Decompress(byte[] input)
{
using (MemoryStream output = new MemoryStream(input))
{
using (GZipStream zip = new GZipStream(output, CompressionMode.Decompress))
{
List<byte> bytes = new List<byte>();
int b = zip.ReadByte();
while (b != -1)
{
bytes.Add((byte)b);
b = zip.ReadByte();
}
return bytes.ToArray();
}
}
直到现在,我还没有找到压缩字节数组的方法,所以我可以使用我的 .NET 方法解压缩它们。 如果你们有任何关于我的问题的信息,请告诉我..
非常感谢.. :)
【问题讨论】:
标签: android asp.net compression titanium base64