Well, my problem today is that when I attempt to send a String[] to the client, it won't print out each index of the String[] :/
Here is what I came up with for reading a ArrayList:
1 2 3 4 5 6 7 8 9 10
| public Object readObject() throws IOException, ClassNotFoundException { Object inc = getInputStream().readObject(); if (inc instanceof ArrayList) { ArrayList<?> list = (ArrayList<?>) inc; int size = list.size(); System.out.println("ArrayList<?> Size: "+size); return list; } return null; } |
Returns:
ArrayList Size: 5
[Stream]: Incoming: [X: 7, X: 71, X: 968, X: 323, X: 584]
Now that works perfect, the client receives the ArrayList, and prints out each index correctly.
Now onto reading a String[], this is what I have so far

:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| public Object readObject() throws IOException, ClassNotFoundException { Object inc = getInputStream().readObject(); if (inc instanceof String[]) { String[] tmp = (String[]) inc; int size = tmp.length; System.out.println("String[] Size: "+size); String[] tmp2 = new String[size]; for (int i = 0; i < size; i++) { tmp2[i] = tmp[i]; return tmp2; } } return null; } |
Returns:
String[] Size: 10
[Stream]: Incoming: [Ljava.lang.String;@24a20892
Please don't post a reply relating to Serialization, for I am attempting to do this my way

.
Any help on this matter would be greatly appreciated.
If you notice a error in the code for reading the String[] please tell me.
Other Info:When I highlight the block of code for reading the String[] in my IDE (Eclipse), it says "Dead Code" T_T.