public Buffer objectToBuffer(Object obj) throws Exception {
   byte[] buf = marshaller.objectToByteBuffer(obj);
   return new Buffer(buf, 0, buf.length);
 }
 public byte[] objectToByteBuffer(Object obj) throws Exception {
   return marshaller.objectToByteBuffer(obj);
 }