/**
   * Deserialize object from byte array using marshaller.
   *
   * @param bytes Bytes to deserialize.
   * @param <X> Result object type.
   * @return Deserialized object.
   * @throws GridException If failed.
   */
  protected <X> X fromBytes(byte[] bytes) throws GridException {
    if (bytes == null || bytes.length == 0) return null;

    return marsh.unmarshal(bytes, getClass().getClassLoader());
  }