/**
  * Serialize object to byte array using marshaller.
  *
  * @param obj Object to convert to byte array.
  * @return Byte array.
  * @throws GridException If failed to convert.
  */
 protected byte[] toBytes(Object obj) throws GridException {
   return marsh.marshal(obj);
 }