title: Want to create byte array in objective c
body: <p>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..</p>
  
  <pre><code>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;
  </code></pre>
  
  <p>this code actually returns eight byte array...Here's the output in java
  [0,0,0,0,69,121,-11,-125]</p>
  
  <p>this is what i want exactly in objective c..</p>