ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
// read past the null/serializable byte
bais.read();
MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
return mvis.readObject();
}
/**
* Serializes a response object into a byte buffer, optimized for response marshalling.
* The object has to implement interface Serializable or Externalizable