Here you can find the source of load(InputStream stream)
public static void load(InputStream stream)
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.*; public class Main { private static final Properties PROPERTIES = new Properties(); public static void load(InputStream stream) { load(stream, false);/*from w w w.j a v a 2 s .c o m*/ } private static void load(InputStream stream, boolean ignoreError) { PROPERTIES.clear(); try { if (stream != null) { PROPERTIES.load(stream); stream.close(); if (PROPERTIES.size() == 0 && !ignoreError) { throw new RuntimeException("Empty [config.properties]!"); } } else if (!ignoreError) { throw new RuntimeException("Config file not found"); } } catch (Exception e) { throw new RuntimeException("Can't load [config.properties]!", e); } } }