• 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
Do NSStreams require data serialization?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Do NSStreams require data serialization?


  • Subject: Do NSStreams require data serialization?
  • From: Carl Hoefs <email@hidden>
  • Date: Thu, 10 Jul 2014 13:13:59 -0700

I'm a bit confused about sending raw data bytes (large blocks of binary ints and floats) over an NSStream. In the Apple NSStream documentation (https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/WritingOutputStreams.html), it's shown how to send the bytes contained within an NSData object directly over the stream, without any prior serialization or conversion. However when I do that, the data seem to become corrupted. MD5='2d9e6650b2ca3440983fabb9fc3c76c8' != '12c89efb8e63235059f3be9988b48b1e'. I'm thinking I may need to serialize the data in some way before sending it over the stream. But the documentation doesn't allude to the need.

What does an NSStream do with the data it sends? Does it serialize it behind the scene, and unserialize it on the receiving end? Or does it just spew raw bits, without any conversion between 'network/host' byte ordering, etc?
-Carl




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Do NSStreams require data serialization?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re(2): Is there a transactional data limit with NSStreams?
  • Next by Date: Re: Re(2): Is there a transactional data limit with NSStreams?
  • Previous by thread: Re: Re(2): Is there a transactional data limit with NSStreams?
  • Next by thread: Re: Do NSStreams require data serialization?
  • Index(es):
    • Date
    • Thread