• 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
bytesize of an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bytesize of an object


  • Subject: bytesize of an object
  • From: Hans van der Meer <email@hidden>
  • Date: Fri, 25 Jan 2008 12:29:26 +0100

I extended NSData with a category in order to implement NSData payload compression, using zlib. That works fine for data for which I know its length, but seems more difficult in case of objects. Like for example NSString's, in which I am especially interested in compressing them.

I could think of two procedures:
(1) using the archiver to pack the NSString into a NSData object from which I can retrieve the payload and then compress it
(2) dump the NSString contents into an array with getCharacters, compress that array and then put it inside a NSData object


However, both procedures need a (seemingly unnecessary) extra step I would like to avoid. If it were possible to find the bytesize of objects, I could do the compression directly on it.

My question thus: is it possible to retrieve the actual bytesize of an object? Or is there another solution to the above compression problem which I am overlooking?

Hans van der Meer




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: bytesize of an object
      • From: Alastair Houghton <email@hidden>
    • Re: bytesize of an object
      • From: Ken Thomases <email@hidden>
  • Prev by Date: How to use CAMediaTiming's beginTime?
  • Next by Date: CoreData - multiple stores advice...
  • Previous by thread: How to use CAMediaTiming's beginTime?
  • Next by thread: Re: bytesize of an object
  • Index(es):
    • Date
    • Thread