Example usage for weka.core.xml XStream serialize

List of usage examples for weka.core.xml XStream serialize

Introduction

In this page you can find the example usage for weka.core.xml XStream serialize.

Prototype

public static String serialize(Object toSerialize) throws Exception 

Source Link

Document

Serializes the supplied object xml

Usage

From source file:de.upb.timok.utils.IoUtils.java

License:Open Source License

public static void xmlSerialize(Object o, Path path) {
    String xml;/*  w  w  w .  java  2s  .c  om*/
    try {
        xml = XStream.serialize(o);
        Files.write(path, xml.getBytes());
    } catch (final Exception e) {
        logger.error("Unexpected exception", e);
    }
}