Do NSStreams require data serialization?
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