Here you can find the source of loadProperties(File file, String charset)
public static Properties loadProperties(File file, String charset) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.Properties; public class Main { public static Properties loadProperties(File file, String charset) throws IOException { InputStream in = null;//from www . ja v a2 s . c o m try { in = new FileInputStream(file); return loadProperties(in, charset); } finally { if (in != null) { in.close(); } } } public static Properties loadProperties(InputStream in, String charset) throws IOException { return loadProperties(new InputStreamReader(in, charset)); } public static Properties loadProperties(Reader reader) throws IOException { Properties props = new Properties(); props.load(reader); return props; } }