PDA

View Full Version : Objective-C: C# BinaryReader and BinaryWriter?




timehacker11
May 1, 2013, 01:30 PM
I'm a .NET programmer, and would like to know if there is an equivalent of .NET's BinaryReader and BinaryWriter for Objective-C.

Thanks,
timehacker11.



mfram
May 1, 2013, 03:40 PM
Perhaps if you told us what they do, we can answer that question. Offhand, given the names... when using an NSData object:

initWithContentsOfFile:options:error:
writeToFile:options:error:

timehacker11
May 1, 2013, 04:06 PM
Basically, Binary Readers and Writers allow you to read and write primitive file types. (Not the usual file types like txt, xml, etc)

I want to read and write to .blight files. The BLIGHT file is described here:
http://wiki.tockdom.com/wiki/Blight_(File_Format)

Thanks,
timehacker11.

gnasher729
May 2, 2013, 05:21 AM
Basically, Binary Readers and Writers allow you to read and write primitive file types. (Not the usual file types like txt, xml, etc)

I want to read and write to .blight files. The BLIGHT file is described here:
http://wiki.tockdom.com/wiki/Blight_(File_Format)

Thanks,
timehacker11.

Use posix calls. Or NSFileHandle. Or NSInputStream. Or the NSData methods mentioned above.