i want to create a byte array in objective c, i am not able to find equivalent code of java's ByteArrayOutputStream and DataOutputStream. for eg..
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
dos.writeLong(counter); //counter is a long data type for eg 1165620611
dos.flush();
byte[] data = bos.toByteArray();
return data;
this code actually returns eight byte array...Here's the output in java [0,0,0,0,69,121,-11,-125]
this is what i want exactly in objective c..