We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent becf8c0 commit 2180303Copy full SHA for 2180303
core-java/src/test/java/org/baeldung/java/io/JavaWriteToFileTest.java
@@ -19,6 +19,7 @@
19
import java.nio.channels.FileChannel;
20
import java.nio.channels.FileLock;
21
import java.nio.channels.OverlappingFileLockException;
22
+import java.nio.charset.Charset;
23
import java.nio.file.Files;
24
import java.nio.file.Path;
25
import java.nio.file.Paths;
@@ -158,7 +159,7 @@ public void givenUsingJava7_whenWritingToFile_thenCorrect() throws IOException {
158
159
160
Files.write(path, strToBytes);
161
- final String read = Files.readAllLines(path).get(0);
162
+ final String read = Files.readAllLines(path, Charset.defaultCharset()).get(0);
163
assertEquals(str, read);
164
}
165
0 commit comments