All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.co.mruoc.file.InputStreamConverter Maven / Gradle / Ivy

Go to download

Code library to easily load files and file from the classpath or file system file

The newest version!
package uk.co.mruoc.file;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.Properties;
import org.apache.commons.io.IOUtils;

public class InputStreamConverter {

    public Properties toProperties(InputStream stream) throws IOException {
        Properties properties = new Properties();
        properties.load(stream);
        return properties;
    }

    public String toString(InputStream stream) throws IOException {
        return IOUtils.toString(stream, Charset.defaultCharset());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy