Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try (BufferedInputStream input = new BufferedInputStream(new FileInputStream("File.txt"))) {
- byte[] bytes = new byte[input.available()];
- if (input.read(bytes) != bytes.length) {
- throw new IOException("Не удалось вычитать все данные из файла!");
- }
- String result = new String(bytes, "UTF-16");
- System.out.println(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement