public MarshalledObject(T obj) throws IOException
{
ByteArrayOutputStream objStream = new ByteArrayOutputStream();
RMIMarshalledObjectOutputStream stream =
new RMIMarshalledObjectOutputStream(objStream);
stream.writeObject(obj);
stream.flush();
objBytes = objStream.toByteArray();
locBytes = stream.getLocBytes();
// The following algorithm of calculating hashCode is similar to String