-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArchiveDisplay.java
More file actions
31 lines (27 loc) · 959 Bytes
/
ArchiveDisplay.java
File metadata and controls
31 lines (27 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.io.*;
/**
* This class prints a quesiton pool.
* @author Michael Roscoe
* @author Adrian Bolesnikov
*/
public class ArchiveDisplay {
public static void main(String[] args) {
try {
FileInputStream in = new FileInputStream("QuestionPool.dat");
BufferedInputStream buffer = new BufferedInputStream(in);
ObjectInputStream o = new ObjectInputStream(buffer);
QuestionQueue queue = (QuestionQueue) o.readObject();
System.out.println("Here are the archived questions...");
if (!queue.isEmpty()) {
System.out.print(queue);
}
o.close();
}
catch (ClassNotFoundException e) {
System.out.println("Class not found - check source package.");
}
catch (IOException e) {
System.out.println("Something went wrong - check file permissions and file location.");
}
}
}