• 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: to write to file except NSData*
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >to write to file except NSData* (From: Nick Rogers <email@hidden>)
 >Re: to write to file except NSData* (From: Thomas Backman <email@hidden>)
 >Re: to write to file except NSData* (From: Nick Rogers <email@hidden>)
 >Re: to write to file except NSData* (From: Alastair Houghton <email@hidden>)
 >Re: to write to file except NSData* (From: Navneet Kumar <email@hidden>)

  • Prev by Date: Re: to write to file except NSData*
  • Next by Date: Re: is this badly written code?
  • Previous by thread: Re: to write to file except NSData*
  • Next by thread: Re: to write to file except NSData*
  • Index(es):
    • Date
    • Thread