@Test(expected = IOException.class) public void testLoad_PropertyInputStream() throws Exception { Properties sample = createTestSample(); byte[] bytes = asByteArray(sample); Properties loaded = load(() -> { return new ByteArrayInputStream(bytes); }); assertEquals(sample.size(), loaded.size()); Properties doesNotExist = load(() -> { throw new IOException(); }); }
public static Properties load(PropertyInputStream e) throws IOException { Properties result = new Properties(); try (InputStream in = e.openStream()) { result.load(in); } return result; }
PropertyHelper { public static Properties load(PropertyInputStream e) throws IOException { Properties result = new Properties(); try (InputStream in = e.openStream()) { result.load(in); } return result; } }
PropertyHelper { public static Properties load(PropertyInputStream e) throws IOException { Properties result = new Properties(); try (InputStream in = e.openStream()) { result.load(in); } return result; }  }
PropertyHelper { public static Properties load(PropertyInputStream e) throws IOException { Properties result = new Properties(); try (InputStream in = e.openStream()) { result.load(in); } return result; }  static Properties getPropertySubset(Properties p, String prefix); static Properties getPropertySubset(Properties p, String prefix, boolean ignoreCase); static String getPropertyIgnoringCase(Properties p, String key, String defaultValue); static Map<String, String> asMap(Properties p); static String getPropertyIgnoringCase(Properties p, String key); static Properties loadQuietly(final File file); static Properties loadQuietly(final String resource); static Properties loadQuietly(final ClassLoader cl, final String resource); static Properties loadQuietly(final URL resource); static Properties loadQuietly(final InputStream in); static Properties loadQuietly(PropertyInputStream e); static Properties load(PropertyInputStream e); }
PropertyHelper { public static Properties load(PropertyInputStream e) throws IOException { Properties result = new Properties(); try (InputStream in = e.openStream()) { result.load(in); } return result; }  static Properties getPropertySubset(Properties p, String prefix); static Properties getPropertySubset(Properties p, String prefix, boolean ignoreCase); static String getPropertyIgnoringCase(Properties p, String key, String defaultValue); static Map<String, String> asMap(Properties p); static String getPropertyIgnoringCase(Properties p, String key); static Properties loadQuietly(final File file); static Properties loadQuietly(final String resource); static Properties loadQuietly(final ClassLoader cl, final String resource); static Properties loadQuietly(final URL resource); static Properties loadQuietly(final InputStream in); static Properties loadQuietly(PropertyInputStream e); static Properties load(PropertyInputStream e);  }