I\'m writing a simple client/server network application that sends and receives fixed size messages through a TCP socket.
So far, I\'ve been using the <
Use DataInputStream.readFully. Here is JavaDoc
InputStream in = ... DataInputStream dis = new DataInputStream( in ); byte[] array = ... dis.readFully( array );