use of org.jboss.marshalling.OutputStreamByteOutput in project wildfly by wildfly.
the class DatabaseTimerPersistence method serialize.
private String serialize(final Serializable serializable) {
if (serializable == null) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
final Marshaller marshaller = factory.createMarshaller(configuration);
marshaller.start(new OutputStreamByteOutput(out));
marshaller.writeObject(serializable);
marshaller.finish();
out.flush();
} catch (IOException e) {
throw new RuntimeException(e);
}
return Base64.getEncoder().encodeToString(out.toByteArray());
}
Aggregations