Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SharpZipLib

5 views
Skip to first unread message

John

unread,
Sep 1, 2003, 8:42:08 PM9/1/03
to
Did anyone use SharpZipLib on the Compact Framework? The docs say that
the support is added. However I am getting a MissingMethodException on
the Read method of ZipInputStream.

Thanks.

Alex Feinman [MVP]

unread,
Sep 2, 2003, 12:17:52 AM9/2/03
to
SharpZLib is compiled against full framework and won't run on the CF because
it references couple of things that are missing from CF. Aside of that it
references wrong system assemblies. I was able to recompile it very quickly
for CF. All that I had to do was to replace calls to Console.Error with
Console and remove attempt to use BufferedStream. The rest is obvious.
Unfortunately I cannot post the results as it would violate GPL, but the
process is really straightforward.

"John" <john...@rediffmail.com> wrote in message
news:ba129ce7.03090...@posting.google.com...

John

unread,
Sep 2, 2003, 7:27:30 PM9/2/03
to
Thanks Alex,
I recompiled with only the Zip code. Worked fine. That way, didn't
even have to remove the code you mentioned plus that cut the assembly
to half the size.

I am testing it now with some dummy data, 1000 files in a 7 MB zip
file. It is taking 17 sec for the ZipFile class to open it on the
emulator. I am using ZipFile class instead of the ZipInputStream class
since I need to extract specific files. So I need
ZipFile.GetInputStream(ZipEntry) rather than
ZipInputStream.GetNextEntry();

Is this delay normal? Seems a bit too long even if it is only once. Is
there a more efficient way to do it?

Thanks again.

"Alex Feinman [MVP]" <publi...@alexfeinman.com> wrote in message news:<u0KTukQ...@TK2MSFTNGP11.phx.gbl>...

Alex Feinman [MVP]

unread,
Sep 2, 2003, 7:45:15 PM9/2/03
to
It's probably the time required to read the zip directory. Or could it be
that you are seing the time it takes to JIT-compile this (rather larger)
library?

Chris Tacke, eMVP

unread,
Sep 2, 2003, 8:10:00 PM9/2/03
to
The best way to answer that is to actually read the GPL, which I highly
recommend. In this case the short is that you can freely modify it, but the
modifications must be made public. I'm not sure what the implications are
on something that uses the new library. Again, this is where reading the
GPL would come in.

-Chris


"Eelco Akker" <eelco...@zonnet.nl> wrote in message
news:eult1OVc...@TK2MSFTNGP12.phx.gbl...
> Dear Alex,
>
> Posted a message at the SharpZiplib Forum and this is what I got.
>
> *************************************************************************
>
>
> 1 Posts
> Posted - 09/02/2003 : 03:13:52
> --------------------------------------------------------------------
>
> Is there already a correct SharpZipLib for the Compact
Framework
>
> I know it is supported, but according to the MS Compact
> Framework newsgroup I should edit some C# source and recompile.
>
> However C# is not my thing, VB .NET is. Can somebody help me ?
>
> (Posting on MS newsgroup)


>
> SharpZLib is compiled against full framework and won't run on
> the CF because
> it references couple of things that are missing from CF. Aside
> of that it
> references wrong system assemblies. I was able to recompile it
> very quickly
> for CF. All that I had to do was to replace calls to
> Console.Error with
> Console and remove attempt to use BufferedStream. The rest is
> obvious.
> Unfortunately I cannot post the results as it would violate
GPL,
> but the
> process is really straightforward.
>
>

> bspuida
>
>
> Austria
> 530 Posts
> Posted - 09/02/2003 : 05:30:41
> --------------------------------------------------------------------
>
> We here at the core team do not at all understand how
modifying
> source code would be against the GPL - after all the GPL expressly allows
> modification of code, provided it is made publicly available. *Not*
> publishing the code modification violates the GPL. Please notify the
author
> of said post of this. We would be happy to see a CF version of the library
> for all of you out there who need it.
>
>
>
>
>
> I am a bit confused about GPL now, what's allowed and what's not ??
>
> Eelco
>
> "Alex Feinman [MVP]" <publi...@alexfeinman.com> schreef in bericht
> news:u0KTukQ...@TK2MSFTNGP11.phx.gbl...

Eelco Akker

unread,
Sep 3, 2003, 11:04:29 AM9/3/03
to
Dear John,

Could you provide me some source samples, howto extract a file on CF

I also recompiled the ZipLib.

But I'm stil getting a missingmethod exception.

This is my source (VB .NET)

----------------------------------------------------------------------------
-----------
Private Sub Unzip(ByVal zipFile As String, ByVal UnzipToFolder As String)
Dim nByte As Integer
Dim s As New ZipInputStream(File.OpenRead(zipFile))
Dim entry As ZipEntry
Dim Zip_Data(2048) As Byte
Zip_Data(2048) = New Byte

entry = s.GetNextEntry

Do

Dim fs As New FileStream(Path.Combine(UnzipToFolder,
Path.GetFileName(entry.Name)), FileMode.Create)

Dim bw As New BinaryWriter(fs, System.Text.Encoding.ASCII)

nByte = s.Read(Zip_Data, 0, Zip_Data.GetLength(0))

While nByte > 0
bw.Write(Zip_Data, 0, nByte)
nByte = s.Read(Zip_Data, 0, Zip_Data.GetLength(0))
End While

fs.Close()
bw.Close()
entry = s.GetNextEntry

Loop While Not (entry Is Nothing)

s.Close()

End Sub

Thanx in advance

"John" <john...@rediffmail.com> schreef in bericht
news:ba129ce7.03090...@posting.google.com...

John

unread,
Sep 3, 2003, 7:05:42 PM9/3/03
to
"Alex Feinman [MVP]" <publi...@alexfeinman.com> wrote in message news:<ekFmDxac...@TK2MSFTNGP11.phx.gbl>...

> It's probably the time required to read the zip directory. Or could it be
> that you are seing the time it takes to JIT-compile this (rather larger)
> library?

17 sec is too long for a 200 MHz processor to read that zip. Not too
long ago that was more or less my desktop config. I doubt that it is
the JIT time either. It's only a 68K lib after my trimmings.

John

unread,
Sep 3, 2003, 7:15:14 PM9/3/03
to
"Eelco Akker" <eelco...@zonnet.nl> wrote in message news:<eQcQ9yic...@tk2msftngp13.phx.gbl>...

> Dear John,
>
> Could you provide me some source samples, howto extract a file on CF
>
> I also recompiled the ZipLib.
>
> But I'm stil getting a missingmethod exception.
>
> This is my source (VB .NET)

Sure Eelco!
Here is my C# snippet

zFile = new ZipFile(@"/Program Files/ZipTestCFCS/z.zip");
ZipEntry MyEntry = zFile.GetEntry("1.txt");

Stream s = zFile.GetInputStream(MyEntry);
int length = Convert.ToInt32(MyEntry.Size);
byte[] ba = new byte[length];
s.Read(ba, 0, length);

Encoding ascii = Encoding.ASCII;
char[] asciiChars = new char[ascii.GetCharCount(ba, 0, ba.Length)];
ascii.GetChars(ba, 0, ba.Length, asciiChars, 0);
return new string(asciiChars);

I did not do anything particularly creative for compiling the lib.
Just created a new project for a Pocket PC lib, drag-dropped Zip and
Checksums folders from the windows explorer to the solution and
compiled.

I can mail you the source of the project and the binary if you want.
That shouldn't violate GPL.

Holger (David) Wagner

unread,
Sep 5, 2003, 6:19:24 AM9/5/03
to

I've only used the GZIP-support, but that works perfectly fine without
any hassles or modifications. Almost like Java ;-)

david
--
Auch das geht vorüber. (Sufi-Weisheit)

Holger (David) Wagner Tel: +49 (89) 890 50 962
Dewetstrasse 1 Mobil: +49 (177) 274 12 45
D-80807 München Fax: +49 (177) 992741245

foz

unread,
Nov 14, 2009, 9:58:46 PM11/14/09
to
let me join u ur email thanks

From http://www.google.com/search?hl=en&q=ziblib+mail&aq=f&oq=&aqi=

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/

0 new messages