Hi,
I have tried to send Vector<String> through TCP socket with the following code:
In client side:
...
Socket socket = null;
DataOutputStream dout;
ObjectOutputStream oos;
dout = new DataOutputStream (socket.getOutputStream());
oos = new ObjectOutputStream (dout);
oos.writeObject(list);
oos.flush();
socket.close();
...
In server side:
...
DataInputStream din;
ObjectInputStream ois;
Vector<String> list;
serverSocket = new ServerSocket(PORT);
socket = serverSocket.accept();
din = new DataInputStream(socket.getInputStream());
ois = new ObjectInputStream (din);
list = (Vector<String>)ois.readObject();
socket.close();
...
However," list = (Vector<String>)ois.readObject(); " give the warning "Warning: Type safety: Unchecked cast from Object to Vecotr<String>". Could anyone give a help?
I have tried to send Vector<String> through TCP socket with the following code:
In client side:
...
Socket socket = null;
DataOutputStream dout;
ObjectOutputStream oos;
dout = new DataOutputStream (socket.getOutputStream());
oos = new ObjectOutputStream (dout);
oos.writeObject(list);
oos.flush();
socket.close();
...
In server side:
...
DataInputStream din;
ObjectInputStream ois;
Vector<String> list;
serverSocket = new ServerSocket(PORT);
socket = serverSocket.accept();
din = new DataInputStream(socket.getInputStream());
ois = new ObjectInputStream (din);
list = (Vector<String>)ois.readObject();
socket.close();
...
However," list = (Vector<String>)ois.readObject(); " give the warning "Warning: Type safety: Unchecked cast from Object to Vecotr<String>". Could anyone give a help?