Hagamos que México crezca..

Prefiere el consumo de lo Hecho en México

Prefiere el consumo de lo Hecho en México
BúsquedaHagamos que México crezca..
![]() Prefiere el consumo de lo Hecho en México Posts Recientes
Conversación |
How to Uncompress Gzip File in Windows Mobile 2005 with C#Every day I was programming a module to get of a FTP File Server a Gzip Compressed File of a sqlite database file that have 10Mb size and compressed have 2.5Mb size.
For make it this I did the following: Operating System: Server: Ubuntu Linux Server Client: Windows Mobile 2005 Hardware: MC70 Symbol Technologies Terminal HP iPaq RX3715 Network Connections: MC70:GPRS-Telcel iPaq RX3715: WiFi 802.11b FTP Server: PureFTPd Programming language: C# Library to uncompress: ZlibCE Linux Application to compress: gzip Problem: My problem was than I had to get a SQLite Database File (near of one hundred thousands records in thirtyfive tables) of a FTP File Server by mean GPRS to one hand held MC70 of Symbol Technologies. The GPRS connection in México is offered by Telcel & Movistar, but at south of Veracruz State the GPRS connection only is available by Telcel. The GPRS Provider in México offer plans of 50Mb BandWidth for $ 55.00 dlls + 15 percent of tax, then to download my DataBase File of 10Mb file size is the 20% of BandWidth Limit, this indicate tha only I could to download five times to the month. To resolve this Problem that represent money for the company, I did use zlib, an Open Source library compression. Using Zlib with gzip in Linux I can to diminish of 10 Mb to 2.5Mb file size, and in the terminal I can download this file by mean of OpenNetCF.Net.Ftp and Uncompress the file with ZlibCE Library, therefore I saving seventy five percent of bandwith. In linux you can to create a GZIP File with the following command:
gzip -c MyFile.txt > MyFile.gz
gzip -c MyOtherFile.txt >> MyFile.gz
using System; using System.Text; using System.IO; using OpenNETCF.Compression; namespace zlibSampleCS { class Program { static void Main(string[] args) { UncompressGZFile(@"\Application\zlibce.gz", @"\Application\zlibce.dll"); } private static void UncompressGZFile(string source, string destiny) { try { GZStream stm = GZStream.OpenRead(File.OpenRead(source)); Stream stmOut = File.Create(destiny); byte[] buf = new byte[8192]; int cb = buf.Length; while ((cb = stm.Read(buf, 0, cb)) != 0) { stmOut.Write(buf, 0, cb); cb = buf.Length; } stm.Close(); stmOut.Close(); } catch (Exception ex) { } } } } If You can to get more info you should to visit OpenNetCF Site[http://www.opennetcf.org] Note: if you see some error of grammar in my writing, put a post and correct to me please.
Fuentes XML de comentario: RSS | Atom
|
Nube de EtiquetasEventosEncuestaComentarios Recientes
|
Dejar un comentario