Pergunta

According to it's doc page, java.util.Properties.load() only accepts a java.io.InputStream . Why is it that I can safely load a FileReader, when it is clearly not a child of InputStream?

This prints the properties from pFile. It works for some reason:

    String pFile = "/path/to/properties/file";
    Properties p = new Properties();
    FileReader fr = new FileReader(pFile);
    p.load(fr);
    System.out.println(p.toString());

Thank you in advance!

Foi útil?

Solução

Because you're using a version of Java >= 1.6, which introduced Properties.load(Reader).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top