Skip to content

Commit 364e65c

Browse files
committed
Fixes matyb#96
1 parent d443efa commit 364e65c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

koans/src/intermediate/AboutFileIO.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class AboutFileIO {
1212

1313
@Koan
1414
public void fileObjectDoesntCreateFile() {
15-
File f = new File("foo.txt");
15+
File f = new File("i-never.exist");
1616
assertEquals(f.exists(), __);
1717
}
1818

@@ -29,11 +29,12 @@ public void fileCreationAndDeletion() throws IOException {
2929
public void basicFileWritingAndReading() throws IOException {
3030
File file = new File("file.txt");
3131
FileWriter fw = new FileWriter(file);
32-
fw.write("First line\nSecond line");
32+
String data = "First line\nSecond line";
33+
fw.write(data);
3334
fw.flush();
3435
fw.close();
3536

36-
char[] in = new char[50];
37+
char[] in = new char[data.length()];
3738
int size = 0;
3839
FileReader fr = new FileReader(file);
3940
size = fr.read(in);

0 commit comments

Comments
 (0)