 <p>To answer the question in your title, I would wrap the <code>SocketOutputStream</code> in a <code>BufferedOutputStream</code> in a <code>DataOutputStream</code> and use the latter's <code>writeInt()</code> method repeatedly. Or you could use <code>ObjectOutputStream</code> in place of <code>DataOutputStream</code>, and serialize the array: <code>objOutStream.writeObject(theArray)</code>. To read it in again on the other end, just wrap the <code>SocketInputStream</code> in (1) a <code>DataInputStream</code> and use <code>readInt()</code> repeatedly, or (2) a <code>ObjectInputStream</code> and use <code>readObject()</code>.</p> <p>(If you don't have to interoperate with other languages, <code>Object*Stream</code> is easier on you)</p>