File compression in .NET - for very large files - DOTNET

This is a discussion on File compression in .NET - for very large files - DOTNET ; Hi I want to compress and decomress files. There is GZipStream class in .Net. However this class requires to allocate buffer equal to the file length to zip it (at least all sample code I saw were like that). The ...

+ Reply to Thread
Results 1 to 4 of 4

File compression in .NET - for very large files

  1. Default File compression in .NET - for very large files

    Hi

    I want to compress and decomress files. There is GZipStream class
    in .Net. However this class requires to allocate buffer equal to the
    file length to zip it (at least all sample code I saw were like that).
    The file size in my case can be really very large and hence I want
    something which does not require to load entire file in memory. Is
    there any way?

    Thanks and best regards
    Amit Dedhia


  2. Default Re: File compression in .NET - for very large files

    "Amit Dedhia" <amitdedhia@yahoo.com> wrote in message
    news:1182409936.258284.44200@i38g2000prf.googlegroups.com...

    > Is there any way?


    http://www.chilkatsoft.com/zip-dotnet.asp


    --
    http://www.markrae.net


  3. Default Re: File compression in .NET - for very large files

    On Jun 21, 8:12 am, Amit Dedhia <amitded...@yahoo.com> wrote:
    > I want to compress and decomress files. There is GZipStream class
    > in .Net. However this class requires to allocate buffer equal to the
    > file length to zip it (at least all sample code I saw were like that).
    > The file size in my case can be really very large and hence I want
    > something which does not require to load entire file in memory. Is
    > there any way?


    You don't need to read the whole file in. Just copy the data from the
    input stream to the GZipStream a chunk (eg 32K) at a time.

    I've got a utility class which makes this easier:
    http://pobox.com/~skeet/csharp/miscutil
    and
    http://pobox.com/~skeet/csharp/miscu...treamutil.html
    in particular.

    Jon


  4. Default Re: File compression in .NET - for very large files

    On Jun 21, 8:20 am, "Mark Rae" <m...@markNOSPAMrae.net> wrote:
    > > Is there any way?

    >
    > http://www.chilkatsoft.com/zip-dotnet.asp


    There's no need to go into commercial software here - the only problem
    for the OP is that all the samples read the whole of the data into
    memory before pumping any of it through the output stream. That's easy
    to fix and worth knowing for other situations too

    Jon


+ Reply to Thread

Similar Threads

  1. Error xHarbour file function for large files
    By Application Development in forum xharbour
    Replies: 0
    Last Post: 09-25-2007, 01:29 PM
  2. accessing parts of large files with File.seek()
    By Application Development in forum Python
    Replies: 2
    Last Post: 08-09-2007, 01:16 AM
  3. post xml and compression for large xml files ?
    By Application Development in forum XML SOAP
    Replies: 0
    Last Post: 10-01-2006, 02:23 AM
  4. plot of large data file = large .eps file?
    By Application Development in forum Graphics
    Replies: 16
    Last Post: 01-12-2006, 04:37 PM
  5. Replies: 4
    Last Post: 08-25-2005, 03:57 AM