bytesize of an object
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