(final Object obj)
| 37 | } |
| 38 | |
| 39 | public static byte[] serialize(final Object obj) throws IOException { |
| 40 | System.out.println("serialize obj: "+ obj.getClass().getName()); |
| 41 | final ByteArrayOutputStream out = new ByteArrayOutputStream(); |
| 42 | final ObjectOutputStream objOut = new ObjectOutputStream(out); |
| 43 | objOut.writeObject(obj); |
| 44 | return out.toByteArray(); |
| 45 | } |
| 46 | |
| 47 | public static Object deserialize(byte[] ser) throws IOException, ClassNotFoundException { |
| 48 | System.out.println("deserialize obj"); |