• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to decompress file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to decompress file


  • Subject: Re: How to decompress file
  • From: Camillo Lugaresi <email@hidden>
  • Date: Thu, 19 Jan 2006 13:12:14 +0100

On 19/gen/06, at 08:31, David Chan wrote:

Hi all,

I am currently given task to rewrite a carbon project (c++) using cocoa (obj-c)
The legacy application I am working with is used to read a special
type of compressed file. At the moment the carbon applicaiton use
datafork to read the data and CDecompressionStream to decompress the
data.
How do you do that in cocoa? How do you decompress an NSData of a
compressed file?
Thanks a lot.

Are you sure you need to rewrite that part? You could use Objective-C+ + and call the existing CDecompressionStream to extract the data, and then parse the decompressed data and package it into objects.
It's also likely that the CDecompressionStream reads the data from the file and decompresses it on the fly (it is called a stream, after all), in which case reading the entire file into an NSData object and then decompressing it would be a technically inferior solution. You could of course use dataWithContentsOfMappedFile:, but depending on the size of the file it might not be practical.


Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to decompress file (From: David Chan <email@hidden>)

  • Prev by Date: Re: Office 2003 (Windows) style menus
  • Next by Date: Re: Office 2003 (Windows) style menus
  • Previous by thread: Re: How to decompress file
  • Next by thread: Re: How to decompress file
  • Index(es):
    • Date
    • Thread