code: @Override
      public final byte[] toBytes(Object o)
      {
  
          try
          {
              if (o != null)
              {
                  if (o instanceof byte[])
                  {
                      return (byte[]) o;
                  }
  
                  ByteArrayOutputStream baos = new ByteArrayOutputStream();
                  ObjectOutputStream oos = new ObjectOutputStream(baos);
                  oos.writeObject(o);
                  oos.close();
                  return baos.toByteArray();
              }
          }
          catch (IOException e)
          {
              log.error("IO exception, Caused by {}.", e);
              throw new PropertyAccessException(e);
          }
          return null;
      }
docs: /*
  (non-Javadoc)
  
  @see
  com.impetus.kundera.property.PropertyAccessor#toBytes(java.lang.Object)