code: public byte[] serialize() throws PersistenceBrokerException
      {
          // Identity is serialized and written to an ObjectOutputStream
          // This ObjectOutputstream is compressed by a GZIPOutputStream
          // and finally written to a ByteArrayOutputStream.
          // the resulting byte[] is returned
          try
          {
              final ByteArrayOutputStream bao = new ByteArrayOutputStream();
              final GZIPOutputStream gos = new GZIPOutputStream(bao);
              final ObjectOutputStream oos = new ObjectOutputStream(gos);
              oos.writeObject(this);
              oos.close();
              gos.close();
              bao.close();
              return bao.toByteArray();
          }
          catch (Exception ignored)
          {
              throw new PersistenceBrokerException(ignored);
          }
      }
docs: Return the serialized form of this Identity.
  
  @return The serialized representation
  @see #fromByteArray
  @deprecated