code: protected static String serialize(Serializable serializable) throws JMSException {
          if (serializable == null) {
              return null;
          }
          String serializedString;
          ObjectOutputStream objectOutputStream = null;
          try {
              ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
              objectOutputStream = new ObjectOutputStream(bytesOut);
              objectOutputStream.writeObject(serializable);
              objectOutputStream.flush();
              serializedString = Base64.encodeAsString(bytesOut.toByteArray());
          } catch (IOException e) {
              LOG.error("IOException: cannot serialize objectMessage", e);
              throw convertExceptionToMessageFormatException(e);
          } finally {
              if (objectOutputStream != null) {
                  try {
                      objectOutputStream.close();
                  } catch (IOException e) {
                      LOG.warn(e.getMessage());
                  }
              }
          }
          return serializedString;
      }
docs: Serialize the <code>Serializable</code> object to <code>String</code>.