• 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: byte swapping large chunks of data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: byte swapping large chunks of data


  • Subject: Re: byte swapping large chunks of data
  • From: "Clark Cox" <email@hidden>
  • Date: Thu, 30 Aug 2007 11:56:52 -0700

On 8/30/07, Jaime Magiera <email@hidden> wrote:
> Hey folks,
>
> Being new to the whole byte-swapping thing, I have a few questions
> while writing data for Quicktime Movies and other files of the like.
> Until now, I've been adding bytes to the files as longs, using
> EndianU32_NtoB for the swapping. This works properly of course.
> However, I'm curious if there are methods for  swapping larger chunks
> of bytes (96, 36, etc.) at a time. (other than iterating)

What do you mean by swapping larger chunks? Just reversing the overall
order of the bytes? Reversing 4-byte units within that larger chunk?
Reversing 2-byte units? a mix of the two?

Any endian swapping, by definition, needs to know the layout of the
data to be swapped. (honestly, iterating is probably your only
solution).

> Is there a way I could do a swap on a whole NSData? That would be the
> ultimate solution.

--
Clark S. Cox III
email@hidden
_______________________________________________

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: 
 >byte swapping large chunks of data (From: Jaime Magiera <email@hidden>)

  • Prev by Date: Re: Where are the target and action variables?
  • Next by Date: Re: Where are the target and action variables?
  • Previous by thread: byte swapping large chunks of data
  • Next by thread: Re: byte swapping large chunks of data
  • Index(es):
    • Date
    • Thread