Skip to main content

Load / save in Java

package com.bayesserver.examples;

import com.bayesserver.Network;

import javax.xml.stream.XMLStreamException;
import java.io.IOException;

public class NetworkLoadSaveExample {

public static void main(String[] args) throws IOException, XMLStreamException {

String fileName = "filename.bayes"; // replace this with your path

// load a network...
Network network = new Network();

network.load(fileName); // You can also load a network from a Stream or a string.

// save a network
network.save(fileName); // You can also save a network to a Stream or to a string.

}
}