Java Preferences import from file

Description

Java Preferences import from file


import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.prefs.Preferences;

public class Main {
  public static void main(String[] argv) throws Exception {
    // Create an input stream on a file
    InputStream is = new BufferedInputStream(new FileInputStream("output.xml"));
    Preferences.importPreferences(is);
    System.out.println("done");
  }/*  w  w w  .  j a va2s. co m*/
}



PreviousNext

Related