Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Class library for file compression

Class library for file compression

Scheduled Pinned Locked Moved C#
csharpsysadmintoolsquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Krishnaraj Barvathaya B
    wrote on last edited by
    #1

    Hi All, I am developing an application for some network utility. Right now looking for a .Net library function to compress files before I send them via network. I tried to work with “System.IO.Compression” namespace. But it supports only gzip, which cannot be opened directly with Winzip. Also I am looking at supporting multiple compression formats such as zip, tar etc. I even tried of using #ZipLib. But for some reason I don’t want to use any 3rd party library. Can anybody suggest me how can I achieve this just using .Net libraries. Thanks in advance, Krishnaraj

    C G M 3 Replies Last reply
    0
    • K Krishnaraj Barvathaya B

      Hi All, I am developing an application for some network utility. Right now looking for a .Net library function to compress files before I send them via network. I tried to work with “System.IO.Compression” namespace. But it supports only gzip, which cannot be opened directly with Winzip. Also I am looking at supporting multiple compression formats such as zip, tar etc. I even tried of using #ZipLib. But for some reason I don’t want to use any 3rd party library. Can anybody suggest me how can I achieve this just using .Net libraries. Thanks in advance, Krishnaraj

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I think J# has a library you can reuse. Apart from that, if you don't want to use ZipLib, you'll have to rewrite it yourself.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      D 1 Reply Last reply
      0
      • C Christian Graus

        I think J# has a library you can reuse. Apart from that, if you don't want to use ZipLib, you'll have to rewrite it yourself.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        D Offline
        D Offline
        dan sh
        wrote on last edited by
        #3

        Using the Zip Classes in the J# Class Libraries to Compress Files and Data with C# [^]

        Avoid Google. Use Blackle[^]

        1 Reply Last reply
        0
        • K Krishnaraj Barvathaya B

          Hi All, I am developing an application for some network utility. Right now looking for a .Net library function to compress files before I send them via network. I tried to work with “System.IO.Compression” namespace. But it supports only gzip, which cannot be opened directly with Winzip. Also I am looking at supporting multiple compression formats such as zip, tar etc. I even tried of using #ZipLib. But for some reason I don’t want to use any 3rd party library. Can anybody suggest me how can I achieve this just using .Net libraries. Thanks in advance, Krishnaraj

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          The Compression namespace only does the actual compression. To turn it into a .zip archive, you basically just add a header before the data. If you only ever put a single file in the archive, most of the header looks the same all the time, so that would be pretty easy to write yourself.

          Despite everything, the person most likely to be fooling you next is yourself.

          1 Reply Last reply
          0
          • K Krishnaraj Barvathaya B

            Hi All, I am developing an application for some network utility. Right now looking for a .Net library function to compress files before I send them via network. I tried to work with “System.IO.Compression” namespace. But it supports only gzip, which cannot be opened directly with Winzip. Also I am looking at supporting multiple compression formats such as zip, tar etc. I even tried of using #ZipLib. But for some reason I don’t want to use any 3rd party library. Can anybody suggest me how can I achieve this just using .Net libraries. Thanks in advance, Krishnaraj

            M Offline
            M Offline
            Mike Dimmick
            wrote on last edited by
            #5

            We generally use #ZipLib[^]. There's an exception which allows it to be used freely in commercial, closed-source products. If you're insistent on doing it only with the supplied libraries, and don't want to go the J# route, System.IO.Compression provides an implementation of the Deflate algorithm in the DeflateStream class. You will need to Deflate each file and write headers as noted in the ZIP Application Note[^], the specification for Zip files.

            DoEvents: Generating unexpected recursion since 1991

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups