diff --git a/src/eva2/client/EvAClient.java b/src/eva2/client/EvAClient.java index b6f0792a..235c06f2 100644 --- a/src/eva2/client/EvAClient.java +++ b/src/eva2/client/EvAClient.java @@ -847,7 +847,8 @@ public class EvAClient implements RemoteStateListener, Serializable { } selectedModule = (String) JOptionPane.showInputDialog(evaFrame.getContentPane(), - "Which module do you want \n to load on host: " + comAdapter.getHostName() + " ?", "Load optimization module on host", + "Which module do you want \n to load on host: " + comAdapter.getHostName() + " ?", + "Load optimization module on host", JOptionPane.QUESTION_MESSAGE, null, ModuleNameList, diff --git a/src/eva2/tools/Serializer.java b/src/eva2/tools/Serializer.java index 8a47084e..351a0a7f 100644 --- a/src/eva2/tools/Serializer.java +++ b/src/eva2/tools/Serializer.java @@ -99,35 +99,38 @@ public class Serializer { } /** - * Serialize the string s and - * store its serialized state in File with name Filename. - * - * @param filename The file + * Serialize the string data and write it to the OutputStream. + * + * @param outStream The output stream * @param data The string data **/ public static void storeString(final OutputStream outStream, final String data) { try { - store(data, outStream, false); + outStream.write(data.getBytes()); } catch (Exception ex) { LOGGER.log(Level.SEVERE, "Could not write string to stream", ex); } } /** - * Deserialize the contents of File filename containing + * Deserialize the contents of the InputStream containing * a string and return the resulting string. * - * @param filename The file - * @return The deserialized data from the file + * @param inputStream The input stream to read from + * @return The deserialized data from the stream **/ public static String loadString(final InputStream inputStream) { - String data = null; + StringBuilder sBuilder = new StringBuilder(); try { - data = (String) load(inputStream); + int data = inputStream.read(); + while (data != -1) { + sBuilder.append((char) data); + data = inputStream.read(); + } } catch (Exception ex) { - LOGGER.log(Level.SEVERE, "Could not load string from file!", ex); + LOGGER.log(Level.SEVERE, "Could not load string from stream!", ex); } - return data; + return sBuilder.toString(); } /**