Re: int to bytes(value in NSString)

2009-08-19 Thread Alastair Houghton
On 19 Aug 2009, at 02:30, bosco fdo wrote: Hi all I dont want in binaries('1', '0'), but i want to convert int to bytes(byte value string) for example in java working code when i convert int value 1 to byte value in 4 square like chars(unreadable format) the same thing i need to do in

Re: int to bytes(value in NSString)

2009-08-19 Thread bosco fdo
Hi all Sorry if i am not clear. But i need to group all binary format data together in my logic for that i need to convert some integer to binary format(byte value?) the below java code make the conversion correct private byte[] int2bin(int i) { byte[] value = new

Re: int to bytes(value in NSString)

2009-08-19 Thread Alastair Houghton
On 19 Aug 2009, at 11:04, bosco fdo wrote: Sorry if i am not clear. But i need to group all binary format data together in my logic for that i need to convert some integer to binary format(byte value?) the below java code make the conversion correct private byte[] int2bin(int i)

Re: int to bytes(value in NSString)

2009-08-18 Thread bosco fdo
Hi graham Thanks for the reply. I have tried %i.1 but i am getting 0.10.10.10.1 , but i need it in binary byte value bos On Tue, Aug 18, 2009 at 10:06 AM, Graham Cox graham@bigpond.com wrote: On 17/08/2009, at 5:07 PM, bosco fdo wrote: I need NSString in binary format how do i

Re: int to bytes(value in NSString)

2009-08-18 Thread Andrew Farmer
On 17 Aug 2009, at 23:21, bosco fdo wrote: Hi graham Thanks for the reply. I have tried %i.1 but i am getting 0.10.10.10.1 , but i need it in binary byte value Wait, you're trying to construct a NSString with null bytes in it? I'm pretty sure that doesn't work correctly in a lot of

Re: int to bytes(value in NSString)

2009-08-18 Thread Graham Cox
On 18/08/2009, at 4:21 PM, bosco fdo wrote: Hi graham Thanks for the reply. I have tried %i.1 but i am getting 0.10.10.10.1 , but i need it in binary byte value bos Sorry, I meant %.1i However it's not really clear what you're trying to do - do you want to display the binary of

Re: int to bytes(value in NSString)

2009-08-18 Thread Jeremy Pereira
On 18 Aug 2009, at 03:06, Graham Cox wrote: On 17/08/2009, at 5:07 PM, bosco fdo wrote: I need NSString in binary format how do i print NSString in binary format instead of 0001 obj-c code is uint8 barr[4]; barr[0] =(uint8)num; barr[1] =(uint8)num8; barr[2] =(uint8)num16; barr[3]

Re: int to bytes(value in NSString)

2009-08-18 Thread bosco fdo
Hi  all    I dont want in binaries('1', '0'), but i want to convert int to bytes(byte value string) for example in java working code when i convert int value 1 to byte value in 4 square like chars(unreadable format) the same thing i need to do in objective c thanks for the help bos On Tue,

int to bytes(value in NSString)

2009-08-17 Thread bosco fdo
Hi I dont understand of the below case of converting int to byte , the below java code can able to print the byte value as below System.out.println(binary output ::: +Byte.toString(bo[0])); System.out.println(binary output ::: +Byte.valueOf(bo[1])); System.out.println(binary output :::

Re: int to bytes(value in NSString)

2009-08-17 Thread Graham Cox
On 17/08/2009, at 5:07 PM, bosco fdo wrote: I need NSString in binary format how do i print NSString in binary format instead of 0001 obj-c code is uint8 barr[4]; barr[0] =(uint8)num; barr[1] =(uint8)num8; barr[2] =(uint8)num16; barr[3] =(uint8)num24; i am using [NSString