-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMyFileWriterTester.java
More file actions
22 lines (22 loc) · 861 Bytes
/
MyFileWriterTester.java
File metadata and controls
22 lines (22 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.io.*;
import java.nio.file.*;
public class MyFileWriterTester {
public static void main(String[] args) {
try{
//Base Case
System.out.println(Files.readString(Paths.get("example.txt")));
System.out.println(MyFileWriter.hashFile("example.txt"));
//Empty File
System.out.println(MyFileWriter.hashFile("empty.txt"));
//Large File (the entire Bee Movie script)
//link to script: https://gist.github.com/MattIPv4/045239bc27b16b2bcf7a3a9a4648c08a
System.out.println(MyFileWriter.hashFile("large.txt"));
//non-ASCII characters
System.out.println(MyFileWriter.hashFile("emoji.txt"));
//non-exsistant file
System.out.println(MyFileWriter.hashFile("MY-FREE-TIME.txt"));
}catch(IOException e){
e.printStackTrace();
}
}
}