80 個の 4 バイト int フィールドで構成されるサーバーから 320 バイトのデータを受信する必要があります。それらを 4 バイトで受け取り、それぞれの int 値を表示するにはどうすればよいですか? ありがとう。
これが受信側に適しているかどうかはわかりません:
//for reading the data from the socket
BufferedInputStream bufferinput=new BufferedInputStream(NewSocket.getInputStream());
DataInputStream datainput=new DataInputStream(bufferinput);
byte[] handsize=new byte[32];
// The control will halt at the below statement till all the 32 bytes are not read from the socket.
datainput.readFully(handsize);