I'm building a system to exchange encoded messages, call it bank and client. The first messages that I need to exchange are long Strings. They appear to be truncated either in the write or read, but I'm not sure how to figure out where.
Read:
client = new Socket(InetAddress.getByName(bankServer), 12345);
displayMessage("Connected to: " + client.getInetAddress().getHostName());
input = new ObjectInputStream(client.getInputStream());
inputString = (String) input.readObject();
Write:
output = new ObjectOutputStream(connection.getOutputStream());
output.flush(); // flush output buffer to send header information
output.writeObject(msgClassOut + msgTypeOut.toString() + key);
output.flush();