public class Example {
public static void main(String[] args) throws IOException {
byte[] bytes = new byte[100];
InputStreamReader fileInputStream = new InputStreamReader(new FileInputStream("/Users/deni/Desktop/Input.txt"));
while (fileInputStream.read() != -1) {
int i = 0;
bytes[i] = (byte) fileInputStream.read();
i++;
}
String string = new String(bytes, StandardCharsets.UTF_8);
System.out.println(string);
}
}
File contains only just number.But when I run this method I get question mark. What is source of this problem and how to solve it? I am from Russia.I have read some other posts related with this problems but it doesn't help me.I tried write javac -J-Duser.language=en Example java. Thank you.