Here you can find the source of loadPropertiesInputStreamToMap(InputStream propertiesInputStream)
public static Map<String, String> loadPropertiesInputStreamToMap(InputStream propertiesInputStream) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; import java.util.Properties; public class Main { public static Map<String, String> loadPropertiesInputStreamToMap(InputStream propertiesInputStream) throws IOException { Properties properties = new Properties(); properties.load(propertiesInputStream); return propertiesToMap(properties); }/*from w w w . ja va 2 s . c o m*/ public static <K, V> Map<K, V> propertiesToMap(Properties properties) { Map<K, V> resultMap = new HashMap<>(); for (Object propertyKey : properties.keySet()) { resultMap.put((K) propertyKey, (V) properties.get((K) propertyKey)); } return resultMap; } }