code: @Override
    public byte[] encode(final T obj) {
      try (final ByteArrayOutputStream bos = new ByteArrayOutputStream();
           final ObjectOutputStream out = new ObjectOutputStream(bos)) {
        out.writeObject(obj);
        return bos.toByteArray();
      } catch (final IOException ex) {
        throw new RemoteRuntimeException(ex);
      }
    }
docs: Encodes the object to bytes.
  
  @param obj the object
  @return bytes
  @throws RemoteRuntimeException