Loads properties from input stream. - Android java.util

Android examples for java.util:Properties

Description

Loads properties from input stream.

Demo Code


//package com.java2s;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Main {
    /**/*from w w  w  .j ava2 s.  c  o  m*/
     * A cache of the properties
     */
    private static Properties props = null;

    /**
     * Loads properties from input stream.
     *
     * @param io
     * @throws IOException
     */
    public static void loadProperties(final InputStream io)
            throws IOException {
        if (null == io) {
            throw new IllegalArgumentException(
                    "Input stream cannot be null.");
        }
        props = new Properties();
        props.load(io);
    }
}

Related Tutorials