- public static String writeMotor(Motor m) throws IOException{\r
- StringWriter sout = new StringWriter();\r
- ObjectOutputStream out = getXStream().createObjectOutputStream(sout);\r
- out.writeObject(m);\r
- out.close();\r
- sout.close();\r
- return sout.toString();\r
- }\r
- \r
- public static Motor readMotor(String s) throws IOException{\r
- StringReader sin = new StringReader(s);\r
- ObjectInputStream in = getXStream().createObjectInputStream(sin);\r
- Motor m;\r
- try {\r
- m = (Motor)in.readObject();\r
- } catch (ClassNotFoundException e) {\r
- throw new IOException("Class not found", e);\r
- }\r
- return m;\r
- }\r