Here you can find the source of load(File f, Class... args)
public static <T> T load(File f, Class... args) throws Exception
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import javax.xml.bind.JAXBContext; import javax.xml.bind.Unmarshaller; public class Main { public static <T> T load(File f, Class... args) throws Exception { return load(new FileInputStream(f), args); }/*w w w . j a va 2 s . c om*/ public static <T> T load(InputStream is, Class... args) throws Exception { JAXBContext jaxb = JAXBContext.newInstance(args); Unmarshaller unmarshaller = jaxb.createUnmarshaller(); return (T) unmarshaller.unmarshal(is); } }