Что то не так
**
Проверь, что данные в файле имеют формат .properties
**
это к чему ??? ну как бы какой в консоль запишешь такой и будет...
package com.javarush.task.task20.task2003;
import java.io.*;
import java.nio.Buffer;
import java.util.*;
/*
Знакомство с properties
*/
public class Solution {
public static Map<String, String> runtimeStorage = new HashMap<>();
public static void save(OutputStream outputStream) throws Exception {
//напишите тут ваш код
for(Map.Entry<String,String> cell : runtimeStorage.entrySet()){
String line = cell.getKey() + "=" + cell.getValue();
outputStream.write(line.getBytes());
}
}
public static void load(InputStream inputStream) throws IOException {
//напишите тут ваш код
BufferedReader input = new BufferedReader(new InputStreamReader(inputStream));
Properties properties = new Properties();
properties.load(input);
Set setKey = properties.keySet();
for (Object cell : setKey){
runtimeStorage.put((String) cell,properties.getProperty((String) cell));
}
}
public static void main(String[] args) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
FileInputStream fos = new FileInputStream(reader.readLine())) {
// FileInputStream fos = new FileInputStream("D:/edit.properties")) {
load(fos);
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(runtimeStorage);
}
}