J'ai un tableau stockant quelques nombres int. Je veux passer ce tableau dans le serveur afin que le serveur puisse calculer la somme des nombres à l'intérieur du tableau et renvoyer les résultats dans le client. Comment pourrais-je faire ça?Comment envoyer un tableau int au serveur (throug socket) en tant que OutputStream?
public static void main(String args[]) {
int[] num = new int[]{0,1,2,3};
if(msg.equalsIgnoreCase("num")){ // msg is user input
// send that array to the server
}
}
http://stackoverflow.com/questions/9520911/java-sending-and-receiving-file-byte-over-sockets –