Serialize the <code>Serializable</code> object to <code>String</code>.
197731
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;
    }
1355059
@SuppressWarnings("unchecked")
    public static <E> String serialize(E object) throws IOException {
        return mapperFor((Class<E>)object.getClass()).serialize(object);
    }
638597
protected ObjectManagerByteArrayOutputStream serialize(java.io.Serializable serializableObject)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "serialize",
                        new Object[] { serializableObject });

        ObjectManagerByteArrayOutputStream byteArrayOutputStream = new ObjectManagerByteArrayOutputStream();
        try {
            java.io.ObjectOutputStream objectOutputStream = new java.io.ObjectOutputStream(byteArrayOutputStream);
            objectOutputStream.writeObject(serializableObject);
            objectOutputStream.close();

        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this,
                                                cclass,
                                                "serialize",
                                                exception,
                                                "1:303:1.8");
            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "serialize",
                           exception);
            throw new PermanentIOException(this,
                                           exception);
        } // catch.

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "serialize",
                       new Object[] { byteArrayOutputStream });
        return byteArrayOutputStream;
    }
567714
public String serialize(Object object) {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Serializing object to Json");
		}
		XStream xstream = new XStream(new JettisonMappedXmlDriver());
		String json = xstream.toXML(object);
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Object serialized well");
		}
		return json;
	}
140956
def _serialize(self, value, attr, obj, **kwargs):
        """"""
        ret = self._validated(value)
        return (
            self._to_string(ret)
            if (self.as_string and ret not in (None, missing_))
            else ret
        )
665492
public String serialize() {
    StringBuilder sb = new StringBuilder();
    boolean first = true;
    for (String key : options.keySet()) {
      if (first) {
        first = false;
      } else {
        sb.append(';');
      }
      sb.append(key).append('=').append(options.get(key));
    }
    return sb.toString();
  }
545559
public JSONBuilder serialize(Object value) {
        if (value == null) {
            _sb.append("null");
        } else {
            Class<?> t = value.getClass();
            if (t.isArray()) {
                _sb.append('[');
                boolean hasElements = false;
                for (int i = 0, ii = Array.getLength(value); i < ii; ++i) {
                    serialize(Array.get(value, i));
                    _sb.append(',');
                    hasElements = true;
                }
                if (hasElements) {
                    _sb.setCharAt(_sb.length()-1, ']');
                } else {
                    _sb.append(']');
                }
            } else if (Iterable.class.isAssignableFrom(t)) {
                _sb.append('[');
                boolean hasElements = false;
                for (Object object: (Iterable<?>)value) {
                    serialize(object);
                    _sb.append(',');
                    hasElements = true;
                }
                if (hasElements) {
                    _sb.setCharAt(_sb.length()-1, ']');
                } else {
                    _sb.append(']');
                }
            } else if (Number.class.isAssignableFrom(t) || Boolean.class.isAssignableFrom(t)) {
                _sb.append(value.toString());
            } else if (String.class == t) {
                quote((String)value);
            } else {
                quote(value.toString());
            }
        }
        return this;
    }
1373093
public byte[] serializeToBytes(final Serializable o) {
        byte[] bytes = null;
        try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             final ObjectOutputStream oos = new ObjectOutputStream(baos)) {
            oos.writeObject(o);
            oos.flush();
            bytes = baos.toByteArray();
        } catch (final IOException e) {
            logger.warn("cannot Java serialize object", e);
        }
        return bytes;
    }
147455
public static byte[] serialize(Object object) {
    	try {
			return serializer.serialize(object);
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
    }
548616
@GwtIncompatible("ObjectOutputStream")
  public void serialize(OutputStream objectOutputStream) throws IOException {
    new java.io.ObjectOutputStream(objectOutputStream).writeObject(this);
  }
1164952
public static ByteBuf serialize(final Serializable serializable) throws Exception {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();;
        ObjectOutputStream os = new ObjectOutputStream(bos);
        os.writeObject(serializable);

        byte[] serialized = bos.toByteArray();
        os.close();
        bos.close();
        return Unpooled.buffer().writeBytes(serialized);
    }
34532
public static String serialize(Element element) {
        Writer sw = new StringBuilderWriter();
        serialize(new DOMSource(element), sw);
        return sw.toString();
    }
121654
public String serialize(Object object) {
		XStream xstream = new XStream();
		return xstream.toXML(object);
	}
944261
public static String serialize(Value value) throws JSONException {
		StringWriter writer = new StringWriter();
		Serializer.serialize(value, writer);
		return writer.toString();
	}
987600
public static String serialize(final Object obj) throws IOException {
		final ObjectMapper mapper = new ObjectMapper();
        mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
		return mapper.writeValueAsString(obj);
		
	}
306075
public static String serialize(String xmlString) {
        StringWriter sw = new StringWriter();
        serialize(asStreamSource(xmlString), sw);
        return sw.toString();
    }
1286612
public String serialize(Map<String, T> map) throws IOException {
        StringWriter sw = new StringWriter();
        JsonGenerator jsonGenerator = LoganSquare.JSON_FACTORY.createGenerator(sw);
        serialize(map, jsonGenerator);
        jsonGenerator.close();
        return sw.toString();
    }