Re: NSStream, parsing NSData to struct

2009-07-09 Thread Graham Cox
On 09/07/2009, at 8:28 PM, Carlo Gulliani wrote: hello, i have NSData ... NSData *d = [NSData dataWithBytes:(char*)&buffer length:len]; NSLog(@"%@", d); // 00185918 b08259d8 1e00> and I have structure typedef struct mrim_header { u_long magic; u_long

NSStream, parsing NSData to struct

2009-07-09 Thread Carlo Gulliani
hello, i have NSData ... NSData *d = [NSData dataWithBytes:(char*)&buffer length:len]; NSLog(@"%@", d); // and I have structure typedef struct mrim_header { u_long magic; u_long proto; u_long seq; u_long msg; u_long dlen; u_longIP; u_longPort; u_charReserved[16]; }mrim_header; how can i pa