/** * Load the INI from a file using the given encoding. * * @param file the file to load * @param encoding the encoding of the file * @throws IOException */ public void load(File file, String encoding) throws IOException { InputStream in = null; try { in = new FileInputStream(file); load(in, encoding); } finally { if (in != null) { in.close(); in = null; } } }
/** * Load the conf from a buffer. This is used to load conf entries from the * mods.d.tar.gz file. * * @param buffer the buffer to load * @param encoding the character encoding for this INI * @throws IOException */ public void load(byte[] buffer, String encoding) throws IOException { InputStream in = null; try { in = new ByteArrayInputStream(buffer); load(in, encoding); } finally { if (in != null) { in.close(); in = null; } } }