Re: to write to file except NSData*
Re: to write to file except NSData*
- Subject: Re: to write to file except NSData*
- From: Alastair Houghton <email@hidden>
- Date: Tue, 15 Apr 2008 16:18:04 +0100
On 15 Apr 2008, at 16:06, Navneet Kumar wrote:
ok,
so if i generate a header NSData object and write that to file, and
then then write the larger NSData object,
how will i read one NSData after the another.
How will i know what length should I read.
excuse me if this sounds very newbie to you.
Well it depends on how you generate it. You're probably right that
it's a bit of an assumption that using a keyed archiver will result in
the same sized NSData every time (or indeed that there will be any
particular limit), so perhaps the OP is best served here by encoding
the lengths manually in an NSMutableData and then writing that (since
at least then the header size could be fixed).
Endianness problems, of course, would need to be dealt with.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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