Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

How to compress Ti.Utils.base64encode??

$
0
0

Hi.. Does anyone know how to compress Ti.Utils.base64encode?? for example i have this code :

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
And this is the method in my web services for decompressing image from titanium (if i can compress my image before):
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();
   }
  }
Until now, i can't find some method for compressing my byte array so i can decompress them using my >NET method.. If u guys have any information about my problem, please tell me..

Many thanks.. :)


Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>