What I would like to achieve by asking this question is to learn how to send and receive 2-Dimensional Arrays to another computer.
The context is that the <
This will work with any primitive type arrays and Object arrays if object type is instanceof Serializable
server
ServerSocket ss = new ServerSocket(port);
Socket s = ss.accept();
ObjectInputStream is = new ObjectInputStream(s.getInputStream());
byte[][] array = (byte[][])is.readObject();
client
byte[][] array = new byte[10][10];
Socket s = new Socket("host", port);
ObjectOutputStream os = new ObjectOutputStream(s.getOutputStream());
os.writeObject(array);
You should create an object out of it. It´s easier to handle afterwards.
After that you serialize it, then you split it in smaller byte[] (if it´s bigger then 64 kb).
You add some bytes to each packet, I prefer
byte[0] = is splited?
byte[1] + byte[2] = sendNumber (just for controlling, it increases after every sent object)
byte[3] = how many parts your object has
byte[4] = what part is it
What you need else.
Afterwards you can easily put the parts together.
I have never used it but i also found a library know as kryonet (while googling).
Have a look... google it properly.