06 File Input and Output Flashcards
It returns the String representation of the Path, eliminating double backslashes.
String toString()
Exception that is thrown if there is an attempt to delete a file without permission.
SecurityException
What are the common characteristics of a text file and binary file?
Size
Name
Date
Time of creation
It depends on other path information.
relative path
Is a collection of fields that contain data about an entity. It is grouped to create files.
record
Method that writes a single character.
write(int c)
Method that skips the specified number of characters.
skip(long n)
Storage that is permanent. It is saved on a disk.
Non-volatile Storage
Method that flushes the stream.
flush()
It is a complete path; it does not require any other information to locate a file on a system.
absolute path
It returns the name in position of the Path specified by the integer parameter.
Path getName(int)
When each record in a file is accessed one after another in the order in which it was stored, the data file is used as a ________ .
sequential access file
Method that can be used to remove a file without encountering an exception if the file does not exist.
deleteIfExists()
It is being used when a Java program stores a value in a variable.
Random Access Memory (RAM)
Exception that is thrown if there is an attempt to delete a directory that has files.
DirectoryNotEmptyException
What are the Path methods? (4)
String toString()
Path getFileName()
int getNameCount()
Path getName(int)
Exception that is thrown if there is an attempt to delete a file that does not exist.
NoSuchFileException
It is a memory location into which you can write data, which you can read again later.
buffer
It performs operations on files and directories , such as determining their attributes, creating input and output streams, and deleting them.
Files class
Argument that opens the file if it exists or creates a new file if it hasn’t existed yet.
CREATE
What two (2) arguments that the readAttributes() method take?
Path object and BasicFileAttributes.class
What are the IO Classes? (10)
InputStream
FileInputStream
BufferedInputStream
OutputStream
FileOutputStream
BufferedOutputStream
PrintStream
Reader
BufferedReader
BufferedWriter
It is the flow of data.
stream
It is the smallest useful piece of data.
character
It is a method that returns the size o the file in bytes.
size()
What are the common methods of the OutputStream Class? (4)
void close()
void flush()
void write(byte[] b)
void write(byte[] b, int off, int len)
It creates objects that contain information about files and directories, such as sizes, locations, creation dates, and is used to check whether a file or directory exists.
Path class
Method that is used to convert a relative path to an absolute path.
toAbsolutePath()
Is a group of character that has some meaning. It is group together to form records.
field
A record’s fields cannot be organized into a single line or can be separated by a character. True or False?
False
Argument that opens the file for writing.
WRITE
What are the methods of the BufferedReader Class?
close()
read()
read(char[] buffer, int off, int len)
readLine()
skip(long n)
Method that is used to create a writable file.
newOutputStream()
A type of stream where data data is taken from a source and is delivered into a program.
input stream
Method used to verify if a file exists and if a program can access it when needed.
checkAccess()
Argument that checks whether the file exists and whether the program has permission to execute the file.
EXECUTE
Method that reads a single character.
read()