

Try this . It worked for me .
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class Sample {
public static void main(String[] args) {
try {
FileInputStream fstream = new FileInputStream("C:\\java\\prop\\message.properties");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
String key[] = null;
// Read File Line By Line
while ((strLine = br.readLine()) != null) {
if (strLine.contains("=")) {
key = strLine.split("=");
System.out.println(key[0]);
} else {
System.out.println(strLine);
}
}
in.close();
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.