Chapter 8: IO Flashcards

1
Q

File method, Returns true if the file or directory exists.

A

File.exists()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

File method, Returns the name of the file or directory denoted by this path.

A

File.getName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

File method, Returns the absolute pathname string of this path.

A

File.getAbsolutePath()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

File method, Returns true if the file denoted by this path is a directory.

A

File.isDirectory()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

File method, Returns true if the file denoted by this path is a file.

A

File.isFile()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

File method, Returns the number of bytes in the file. For performance reasons, the file system may allocate more bytes on disk than the file actually uses.

A

File.length()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

File method, Returns the number of milliseconds since the epoch when the file was last modified.

A

File.lastModified()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

File method, Deletes the file or directory. If this pathname denotes a directory, then the directory must be empty in order to be deleted.

A

File.delete()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

File method, Renames the file denoted by this path.

A

File.renameTo(File)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

File method, Creates the directory named by this path.

A

File.mkdir()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

File method, Creates the directory named by this path including any nonexistent parent directories.

A

File.mkdirs()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

File method, Returns the abstract pathname of this abstract pathname’s parent or null if this pathname does not name a parent directory.

A

File.getParent()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

File method, Returns a File[] array denoting the files in the directory.

A

File.listFiles()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Abstract Class for reading/writing files in characters

A

Reader/Writer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Abstract class for reading/writing files in bytes

A

InputStream/OutputStream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Reads file data as bytes

A

FileInputStream

17
Q

Writes file data as bytes

A

FileOutputStream

18
Q

Reads file data as Characters

A

FileReader

19
Q

Writes file data as Characters

A

FileWriter

20
Q

Reads character data from an existing Reader in a buffered manner, which improves efficiency and performance

A

BufferedReader

21
Q

Writes character data to an existing Writer in a buffered manner, which improves efficiency and performance

A

BufferedWriter

22
Q

Reads character data from an existing InputStream

A

InputStreamReader

23
Q

Writes character data to an existing OutputStream

A

OutputStreamWriter

24
Q

Writes formatted representations of Java objects to a binary stream

A

PrintStream

25
Writes formatted representations of Java objects to a text-based output stream
PrintWriter
26
InputStream and Reader class method for checking if mark(int i) is supported
markSupported()
27
methods to move the stream back to an earlier position
mark, reset
28
skip number of bytes
skip(bytes)