> --- branches/mule-2.2.x/core/src/main/java/org/mule/util/IOUtils.java 2009-10-26 14:16:23 UTC (rev 15875)
> +++ branches/mule-2.2.x/core/src/main/java/org/mule/util/IOUtils.java 2009-10-26 20:01:01 UTC (rev 15876)
> @@ -12,9 +12,16 @@
[...]
> + public static byte[] serialize(Serializable obj) throws IOException
> + {
> + ByteArrayOutputStream stream = new ByteArrayOutputStream();
> + ObjectOutput serialStream = new ObjectOutputStream(stream);
> + serialStream.writeObject(obj);
> + return stream.toByteArray();
> + }
> +
> + public static Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
> + {
> + InputStream stream = new ByteArrayInputStream(bytes);
> + ObjectInput serialStream = new ObjectInputStream(stream);
> + return serialStream.readObject();
> + }
> }
Travis, any reason not to use SerializationUtils which has exactly this
code (plus better exception handling)?
-dirk
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email